Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

Commit

Permalink
improve the way the processor is invoked
Browse files Browse the repository at this point in the history
  • Loading branch information
ttung committed Feb 18, 2015
1 parent cb40387 commit 86f29b5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 58 deletions.
19 changes: 1 addition & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,10 @@ To use this library, add this to your build.gradle file:
srcDir 'src/main/java'
}
}
gensrc {
java {
srcDir 'gen-src/main/java'
}
}
}

compileJava {
doFirst {
// Directory should exists before compilation started.
generatedSourcesDir.mkdirs()
}
options.compilerArgs += [
'-processor',
'com.instagram.common.json.annotation.processor.JsonAnnotationProcessor',
'-s',
generatedSourcesDir
]
}
dependencies {
compile group: 'com.instagram', name: 'ig-json-parser-processor', version: '0.0.5+'
compile group: 'com.instagram', name: 'ig-json-parser-processor', version: '0.0.6+'
}


Expand Down
21 changes: 11 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ task processorJar(type: Jar,
from files( { project(':common').sourceSets.main.output.classesDir } )
from files( { project(':util').sourceSets.main.output.classesDir } )
from files( { project(':processor').sourceSets.main.output.classesDir } )
from files( { project(':processor').sourceSets.main.output.resourcesDir } )
baseName 'processor'
}

Expand All @@ -27,20 +28,20 @@ task runtimeJar(type: Jar,
task runtimeSourcesJar(type: Jar) {
classifier = 'sources'
baseName 'runtime'
from files( { project(':common').sourceSets.main.allSource } )
from files( { project(':common').sourceSets.main.allJava } )
}

task processorSourcesJar(type: Jar) {
classifier = 'sources'
baseName 'processor'
from files( { project(':javawriter').sourceSets.main.allSource } )
from files( { project(':common').sourceSets.main.allSource } )
from files( { project(':util').sourceSets.main.allSource } )
from files( { project(':processor').sourceSets.main.allSource } )
from files( { project(':javawriter').sourceSets.main.allJava } )
from files( { project(':common').sourceSets.main.allJava } )
from files( { project(':util').sourceSets.main.allJava } )
from files( { project(':processor').sourceSets.main.allJava } )
}

task runtimeJavadoc(type: Javadoc) {
source files( { project(':common').sourceSets.main.allSource } )
source files( { project(':common').sourceSets.main.allJava } )
destinationDir = new File("${project.docsDir}", "runtime-javadoc")
}

Expand All @@ -51,10 +52,10 @@ task runtimeJavadocJar(type: Jar, dependsOn: runtimeJavadoc) {
}

task processorJavadoc(type: Javadoc) {
source files( { project(':javawriter').sourceSets.main.allSource } )
source files( { project(':common').sourceSets.main.allSource } )
source files( { project(':util').sourceSets.main.allSource } )
source files( { project(':processor').sourceSets.main.allSource } )
source files( { project(':javawriter').sourceSets.main.allJava } )
source files( { project(':common').sourceSets.main.allJava } )
source files( { project(':util').sourceSets.main.allJava } )
source files( { project(':processor').sourceSets.main.allJava } )
destinationDir = new File("${project.docsDir}", "processor-javadoc")
}

Expand Down
8 changes: 0 additions & 8 deletions maven-example/Dessert.java

This file was deleted.

23 changes: 1 addition & 22 deletions maven-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ apply plugin: 'java'
sourceCompatibility = 1.7
targetCompatibility = 1.7

ext {
generatedSourcesDir = file("gen-src/main/java")
}

repositories {
mavenCentral()
}
Expand All @@ -17,25 +13,8 @@ sourceSets {
srcDir 'src/main/java'
}
}
gensrc {
java {
srcDir 'gen-src/main/java'
}
}
}

compileJava {
doFirst {
// Directory should exists before compilation started.
generatedSourcesDir.mkdirs()
}
options.compilerArgs += [
'-processor',
'com.instagram.common.json.annotation.processor.JsonAnnotationProcessor',
'-s',
generatedSourcesDir
]
}
dependencies {
compile group: 'com.instagram', name: 'ig-json-parser-processor', version: '0.0.3+'
compile group: 'com.instagram', name: 'ig-json-parser-processor', version: '0.0.6+'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.instagram.common.json.annotation.processor.JsonAnnotationProcessor

0 comments on commit 86f29b5

Please sign in to comment.