Skip to content

Commit

Permalink
[gradle] warn the user about failed local builds
Browse files Browse the repository at this point in the history
  • Loading branch information
oehme committed Dec 7, 2015
1 parent e05d406 commit f64c95a
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions gradle/java-compiler-settings.gradle
Expand Up @@ -12,18 +12,31 @@ tasks.withType(JavaCompile) {
* already compiles the code. Just reuse the classes
* from the bin folder
*/

if (!isBuildServer) {
project.gradle.addListener LocalBuildWarning.INSTANCE

plugins.withType(JavaPlugin) {
compileJava.enabled = false
processResources.enabled = false

task copyFromBin(type: Sync) {
from 'bin'
into 'build/classes/main'
}

classes {
dependsOn(copyFromBin)
}
}
}

class LocalBuildWarning extends BuildAdapter {
static def INSTANCE = new LocalBuildWarning()

void buildFinished(BuildResult result) {
if (result.failure) {
result.gradle.rootProject.logger.warn("This was a local build, make sure Eclipse is running and successfully compiled the code. Otherwise use the '-PbuildServer' option")
}
}
}

0 comments on commit f64c95a

Please sign in to comment.