Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Grails:添加编译的构建任务_Grails_Build_Code Generation_Amazon Swf - Fatal编程技术网

Grails:添加编译的构建任务

Grails:添加编译的构建任务,grails,build,code-generation,amazon-swf,Grails,Build,Code Generation,Amazon Swf,我正在使用Grails2.4.4。 我的一些类带有注释,APT(注释处理工具)必须在编译过程中处理这些注释以生成一些源代码 通过运行grailsgenerate pom并从中添加特定插件并配置它们,我能够完成创建maven pom.xml的所有工作 是否有可能使用内置的grails编译器configBuildConfig.groovy来达到相同的目标,而不必绕道maven pom.xml 更具体地说,我正在使用AWS SWF创建一个工作流。SWF使用的注释应该会生成一些客户机类。因此,我在pom

我正在使用Grails2.4.4。 我的一些类带有注释,APT(注释处理工具)必须在编译过程中处理这些注释以生成一些源代码

通过运行
grailsgenerate pom
并从中添加特定插件并配置它们,我能够完成创建maven pom.xml的所有工作

是否有可能使用内置的grails编译器config
BuildConfig.groovy
来达到相同的目标,而不必绕道maven pom.xml

更具体地说,我正在使用AWS SWF创建一个工作流。SWF使用的注释应该会生成一些客户机类。因此,我在pom.xml中添加了这个。当我运行
mvn compile
时,它工作得非常好:

<build>
...
    <plugin>
                <groupId>com.mysema.maven</groupId>
                <artifactId>apt-maven-plugin</artifactId>
                <version>1.1.3</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>src/generated</outputDirectory>
                            <processor>com.amazonaws.eclipse.simpleworkflow.asynchrony.annotationprocessor.AsynchronyDeciderAnnotationProcessor</processor>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.amazonaws</groupId>
                        <artifactId>aws-java-sdk-flow-build-tools</artifactId>
                        <version>1.9.34</version>
                    </dependency>
                    <dependency>
                        <groupId>org.freemarker</groupId>
                        <artifactId>freemarker</artifactId>
                        <version>2.3.21</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.commons</groupId>
                        <artifactId>commons-lang3</artifactId>
                        <version>3.3.2</version>
                    </dependency>
                </dependencies>
            </plugin>
...
</build>

...
com.mysema.maven
aptmaven插件
1.1.3
过程
src/generated
com.amazonaws.eclipse.simpleworkflow.asynchrony.annotationprocessor.asynchronydecideranotationprocessor
亚马逊网站
aws java sdk流构建工具
1.9.34
org.freemarker
自由标记
2.3.21
org.apache.commons
commons-lang3
3.3.2
...

我发现了如何在grails中使用它。 基本上,我创建了一个可以用grails命令调用的脚本。这个脚本只是一个
gant
脚本,您可以使用它来干扰ant。另外,我必须将库添加到grails中的
libs
文件夹中,以便将它们放在类路径中

以下是步骤:

  • 创建一个新的grails脚本

    grails create script generateSources
    这将在grails scripts目录中创建一个名为generateSources.groovy的脚本

  • 编辑
    GenerateSources.groovy
    文件

    includeTargets