Rev 1688 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1688 | chris | 1 | apply plugin: "java" |
| 2 | |||
| 3 | sourceCompatibility = 1.6 |
||
| 4 | [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' |
||
| 5 | |||
| 1707 | chris | 6 | sourceSets.main.java.srcDirs = [ "src" ] |
| 1688 | chris | 7 | |
| 1707 | chris | 8 | sourceSets { |
| 9 | input { |
||
| 10 | java { |
||
| 11 | srcDirs = ['src'] |
||
| 12 | } |
||
| 13 | } |
||
| 14 | |||
| 15 | generated { |
||
| 16 | java { |
||
| 17 | srcDirs = ['editor_info'] |
||
| 18 | } |
||
| 19 | } |
||
| 20 | } |
||
| 1688 | chris | 21 | |
| 22 | eclipse.project { |
||
| 23 | name = appName + "-core" |
||
| 24 | } |
||
| 1707 | chris | 25 | |
| 26 | |||
| 27 | task generateEditorInfo(type: JavaCompile, group: 'build', description: 'Generate Editor info files') { |
||
| 28 | outputs.upToDateWhen { false } |
||
| 29 | source = sourceSets.input.java // input source set |
||
| 30 | classpath = configurations.compile // add processor module to classpath |
||
| 31 | // specify javac arguments |
||
| 32 | options.compilerArgs = [ |
||
| 33 | "-proc:only", |
||
| 34 | "-processor", "com.gebauz.bauzoid2.annotation.EditorAnnotationProcessor" // your processor here |
||
| 35 | ] |
||
| 36 | // specify output of generated code |
||
| 37 | destinationDir = sourceSets.generated.java.srcDirs.iterator().next() |
||
| 38 | } |
||
| 39 | |||
| 40 | compileJava { |
||
| 41 | dependsOn generateEditorInfo |
||
| 42 | source generateEditorInfo.destinationDir |
||
| 43 | } |