Introduce src/gen/java for generated sources
Previously, sources generated from the serpent antlr grammar in ethereumj-core/src/main/antlr4 were output into the build/generated-src directory by default. This worked from the command line without issue, but caused issues within IDEA, because the entirety of the 'build' directory is excluded from compilation by default when working with a Gradle-based project in IDEA. This change simplifies the arrangement by writing these antlr-generated sources to the src/gen/java. A .gitignore file has been added to ensure that transient source files don't accidentally get checked in. A readme file has been added to explain the situation to the uninitiated.
This commit is contained in:
parent
7af08b54b5
commit
2a8ecab299
|
@ -26,6 +26,12 @@ Run `./gradlew build`.
|
||||||
- run `./gradlew run`, or
|
- run `./gradlew run`, or
|
||||||
- build a standalone executable jar with `./gradlew shadow` and execute the `-all` jar in `build/libs` using `java -jar [jarfile]`.
|
- build a standalone executable jar with `./gradlew shadow` and execute the `-all` jar in `build/libs` using `java -jar [jarfile]`.
|
||||||
|
|
||||||
|
#### Import sources into IntelliJ IDEA
|
||||||
|
|
||||||
|
Use IDEA 14 or better and import project based on Gradle sources.
|
||||||
|
|
||||||
|
Note that in order to build the project without errors in IDEA, you will need to run `gradle antlr4` manually.
|
||||||
|
|
||||||
#### Publish ethereumj-core builds
|
#### Publish ethereumj-core builds
|
||||||
|
|
||||||
_TODO: integrate bintray gradle plugin_
|
_TODO: integrate bintray gradle plugin_
|
||||||
|
|
|
@ -15,18 +15,21 @@ version = '0.7.15-SNAPSHOT'
|
||||||
|
|
||||||
mainClassName = 'org.ethereum.Start'
|
mainClassName = 'org.ethereum.Start'
|
||||||
|
|
||||||
compileJava.dependsOn antlr4
|
ext.generatedSrcDir = file('src/gen/java')
|
||||||
|
|
||||||
sourceSets.main.java.srcDirs += antlr4.output
|
sourceSets.main.java.srcDirs += generatedSrcDir
|
||||||
|
|
||||||
|
antlr4 {
|
||||||
|
extraArgs = ['-package', 'org.ethereum.serpent']
|
||||||
|
output = file("${generatedSrcDir}/org/ethereum/serpent")
|
||||||
|
}
|
||||||
|
|
||||||
|
compileJava.dependsOn antlr4
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
compile.extendsFrom antlr4
|
compile.extendsFrom antlr4
|
||||||
}
|
}
|
||||||
|
|
||||||
antlr4 {
|
|
||||||
extraArgs=['-package', 'org.ethereum.serpent']
|
|
||||||
}
|
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
slf4jVersion = '1.7.7'
|
slf4jVersion = '1.7.7'
|
||||||
leveldbVersion = '0.7'
|
leveldbVersion = '0.7'
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
*
|
||||||
|
!.gitignore
|
||||||
|
!README.md
|
|
@ -0,0 +1,5 @@
|
||||||
|
This is the output directory for transient sources generated from grammars in
|
||||||
|
the `src/main/antlr4` directory using the `gradle antlr4` task. Sources are
|
||||||
|
output here instead of the typical `build/generated-src` output directory in
|
||||||
|
order to avoid confusing IntelliJ IDEA. See the antlr plugin configuration in
|
||||||
|
`build.gradle` for details.
|
Loading…
Reference in New Issue