Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize incremental builds and local build cache usage #1807

Merged
merged 3 commits into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,9 @@ allprojects {

javadoc.destinationDir = file("build/docs/apidocs")
javadoc.options.addStringOption('Xdoclint:none', '-quiet')
// Workaround frpm https://bugs.openjdk.org/browse/JDK-4973681
javadoc.options.addStringOption('sourcepath', 'src/main/java')

// work around https://github.com/gradle/gradle/issues/4046
javadoc.dependsOn('copyJavadocDocFiles')
task copyJavadocDocFiles(type: Copy) {
from('src/main/java')
into 'build/docs/apidocs'
include '**/doc-files/*.*'
}
if (!project.name in ['picocli-examples', 'picocli-annotation-processing-tests']) {
//sourceSets.main.java.srcDirs = ['src/main/java', 'src/main/java9']
compileJava {
Expand All @@ -136,6 +131,14 @@ allprojects {
neverCompileModuleInfo = true
}
}

normalization {
runtimeClasspath {
metaInf {
ignoreAttribute("Bnd-LastModified")
}
}
}
}

//sourceSets.main.java.srcDirs = ['src/main/java', 'src/main/java9']
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.gradle.caching = false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't commit this.

1 change: 1 addition & 0 deletions picocli-codegen/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ task generateManpageAsciiDoc(type: JavaExec) {
description = "Generate AsciiDoc manpage"
classpath(configurations.compileClasspath, configurations.annotationProcessor, sourceSets.main.runtimeClasspath)
mainClass = 'picocli.codegen.docgen.manpage.ManPageGenerator'
outputs.dir("${project.buildDir}/picocli-generated-docs")
args 'picocli.codegen.docgen.manpage.ManPageGenerator$App',
'picocli.codegen.aot.graalvm.DynamicProxyConfigGenerator$App',
'picocli.codegen.aot.graalvm.ReflectionConfigGenerator$App',
Expand Down
10 changes: 9 additions & 1 deletion picocli-examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,24 @@ sourceSets {
//a task that generates the resources for the example VersionProviderDemo1:
task generateVersionTxt {
description 'Creates a version.txt file with build info that is added to the root of the picocli-examples jar'
def generated = new File(generatedResources, "version.txt")
outputs.file(generated)
doLast {
new File(generatedResources).mkdirs()
def generated = new File(generatedResources, "version.txt")
generated.text = """
Version: $rootProject.version
Buildtime: ${new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())}
Application-name: $rootProject.name $project.name
"""
}
}
normalization {
runtimeClasspath {
properties('**/version.txt') {
ignoreProperty 'Buildtime'
}
}
}

tasks.withType(Javadoc).all { enabled = false }
//tasks.withType(Javadoc) {
Expand Down
1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ if (org.gradle.api.JavaVersion.current().isJava8Compatible()) {
} else {
println("Excluding module picocli-annotation-processing-tests from the build: they require Java 8 but we have Java version ${org.gradle.api.JavaVersion.current()}")
}