Command line compiler for XTend

后端 未结 2 834
谎友^
谎友^ 2021-02-15 15:34

Hi all
I\'ve found XTend (http://xtend-lang.org) and it really sounds great! But, I can\'t see any standalone command line compiler for this language. It seems only to run un

2条回答
  •  失恋的感觉
    2021-02-15 16:23

    You can use the xtend standalone compiler. For my case I copied the following .jar files to a folder named xtendc:

    com.google.guava_21.0.0.v20170206-1425.jar
    com.google.inject_3.0.0.v201312141243.jar
    javax.inject_1.0.0.v20091030.jar
    org.antlr.runtime_3.2.0.v201101311130.jar
    org.apache.log4j_1.2.15.v201012070815.jar
    org.eclipse.emf.common_2.15.0.v20180914-1817.jar
    org.eclipse.emf.ecore.xmi_2.15.0.v20180706-1146.jar
    org.eclipse.emf.ecore_2.16.0.v20181124-0637.jar
    org.eclipse.equinox.common_3.10.200.v20181021-1645.jar
    org.eclipse.jdt.core_3.16.0.v20181130-1748.jar
    org.eclipse.xtend.core_2.16.0.v20181203-1347.jar
    org.eclipse.xtend.lib.macro_2.16.0.v20181203-0507.jar
    org.eclipse.xtext.common.types_2.16.0.v20181203-0528.jar
    org.eclipse.xtext.util_2.16.0.v20181203-0514.jar
    org.eclipse.xtext.xbase.lib_2.16.0.v20181203-0507.jar
    org.eclipse.xtext.xbase_2.16.0.v20181203-0528.jar
    org.eclipse.xtext_2.16.0.v20181203-0514.jar
    org.objectweb.asm_7.0.0.v20181030-2244.jar
    

    And then, in that folder I executed the CLI main class of the batch compiler:

    java -cp "*" org.eclipse.xtend.core.compiler.batch.Main -d   -useCurrentClassLoader 
    

    CLI usage of main class is documented to be as following:

    Usage: Main  
    where possible options include:
    -d                       Specify where to place generated xtend files
    -tp                           Temp directory to hold generated stubs and classes
    -cp                           Specify where to find user class files
    -encoding                 Specify character encoding used by source files
    -javaSourceVersion         Create Java Source compatible to this version. Can be: 1.5, 1.6, 1.7, 1.8, 9, 10
    -noSuppressWarningsAnnotation       Don't put @SuppressWarnings() into generated Java Code
    -generateGeneratedAnnotation        Put @Generated into generated Java Code
    -includeDateInGeneratedAnnnotation  If -generateGeneratedAnnotation is used, add the current date/time.
    -generateAnnotationComment  If -generateGeneratedAnnotation is used, add a comment.
    -useCurrentClassLoader              Use current classloader as parent classloader
    -writeTraceFiles                    Write Trace-Files
    

    so you will need to pass your classpath there.

提交回复
热议问题