My gradle.build file is really simple:
apply from: "${System.getenv().GRADLE_COMMON}/plugins/common.gradle"
dependencies {
compile group: 'commons-logging', name: 'commons-logging', version: '1.1'
compile group: 'log4j', name: 'log4j', version: '1.2.14'
testCompile group: 'junit', name: 'junit', version: '4.4'
testCompile group: 'org.easymock', name: 'easymock', version: '2.3'
testCompile group: 'org.easymock', name: 'easymockclassextension',
version: '2.3'
}
artifactoryPublish {
dependsOn test
publishConfigs("archives")
}
and common.gradle is:
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'artifactory'
// Define some useful paths and set buildDir
USEFUL_PATH_1 = "foo"
USEFUL_PATH_2 = "bar"
buildDir = "/var/tmp/${System.getenv().USER}/build/" + PROJECT_SPECIFIC_PATH
// Define the source sets.
sourceSets {
main {
java {
srcDirs 'main/java'
}
resources {
srcDirs 'main/resources'
}
}
test {
java {
srcDirs 'test/java'
}
resources {
srcDirs 'test/resources'
}
}
}
// Use our Artifactory virtual repository to resolve all dependencies.
repositories {
mavenRepo urls: ARTIFACTORY_URL
}
// Turn on deprecation and unchecked warnings.
compileJava {
options.compilerArgs.add '-Xlint:deprecation'
options.compilerArgs.add '-Xlint:unchecked'
}
compileTestJava {
options.compilerArgs.add '-Xlint:deprecation'
options.compilerArgs.add '-Xlint:unchecked'
}
// Fix the clean task.
deleteDirClosure = {
it.eachDir(deleteDirClosure)
it.eachFile {
it.delete()
}
}
clean {
if (buildDir.exists()) {
deleteDirClosure(buildDir)
}
}
// Configuration for uploading build artifacts to Artifactory.
artifactory {
// Some Artifactory-specific stuff.
}
the output of 'gradle build -i' is:
Executing task ':MY_PROJECT:compileJava' due to:
Output file /var/tmp/dumitru/build/PROJECT_SPECIFIC_PATH/dependency-cache
for task ':MY_PROJECT:compileJava' has changed.
Output file /var/tmp/dumitru/build/PROJECT_SPECIFIC_PATH/classes/main for
task ':MY_PROJECT:compileJava' has changed.
Output file
/var/tmp/dumitru/build/PROJECT_SPECIFIC_PATH/classes/main/PACKAGE_PATH/JAVA_CLASS.class
has been removed for task ':MY_PROJECT:compileJava'.
Output file
/var/tmp/dumitru/build/PROJECT_SPECIFIC_PATH/classes/main/PACKAGE_PATH/JAVA_CLASS.class
has been removed for task ':MY_PROJECT:compileJava'.
(and a few more lines like this)
I should mention that I made some changes to the gradle source code: I added
a custom dependency resolver, but it doesn't process any dependency for this
project, and I changed AbstractProject.path to always be
'Project.PATH_SEPARATOR + name' (that's why the task name is
":MY_PROJECT:compileJava" instead of just ":compileJava"). However, it seems
to me that none of these changes should affect the incremental build code.
--
View this message in context:
http://gradle.1045684.n5.nabble.com/Having-trouble-with-the-incremental-build-tp4842302p4842431.html
Sent from the gradle-user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email