diff options
author | Shevek <[email protected]> | 2013-12-27 05:49:13 -0800 |
---|---|---|
committer | Shevek <[email protected]> | 2013-12-27 05:49:13 -0800 |
commit | bdc6c852f418c3e042aa41469d84544e5f60a526 (patch) | |
tree | 7866346f0fa48ad46a6a427d016dd4b83451dbbe /gradle/convention.gradle | |
parent | 39264fd6d2a6646e49f83b5b2b3512c1663a1c9b (diff) |
Version bump to 1.4.0-SNAPSHOT.
Rewrite build system to use gradle.
Clean up source for the new generation.
Diffstat (limited to 'gradle/convention.gradle')
-rw-r--r-- | gradle/convention.gradle | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/gradle/convention.gradle b/gradle/convention.gradle new file mode 100644 index 0000000..22023ea --- /dev/null +++ b/gradle/convention.gradle @@ -0,0 +1,88 @@ +apply plugin: 'java' // Plugin as major conventions, overwrites status + +sourceCompatibility = 1.5 + +// GRADLE-2087 workaround, perform after java plugin +status = project.hasProperty('preferredStatus')?project.preferredStatus:(version.contains('SNAPSHOT')?'snapshot':'release') + +// Indenting to align with multi-project branch + task sourcesJar(type: Jar, dependsOn:classes) { + from sourceSets.main.allSource + classifier 'sources' + extension 'jar' + } + + task javadocJar(type: Jar, dependsOn:javadoc) { + from javadoc.destinationDir + classifier 'javadoc' + extension 'jar' + } + + configurations.add('sources') + configurations.add('javadoc') + configurations.archives { + extendsFrom configurations.sources + extendsFrom configurations.javadoc + } + + // When outputing to an Ivy repo, we want to use the proper type field + gradle.taskGraph.whenReady { + def isNotMaven = !it.hasTask(project.uploadMavenCentral) + if (isNotMaven) { + def artifacts = project.configurations.sources.artifacts + def sourceArtifact = artifacts.iterator().next() + sourceArtifact.type = 'sources' + } + } + + artifacts { + sources(sourcesJar) { + // Weird Gradle quirk where type will be used for the extension, but only for sources + type 'jar' + } + javadoc(javadocJar) { + type 'javadoc' + } + } + + configurations { + provided { + description = 'much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive.' + transitive = true + visible = true + } + } + + project.sourceSets { + main.compileClasspath += project.configurations.provided + main.runtimeClasspath -= project.configurations.provided + test.compileClasspath += project.configurations.provided + test.runtimeClasspath += project.configurations.provided + } + +/* +apply plugin: 'github-pages' // Used to create publishGhPages task + +def docTasks = [:] +[Javadoc,ScalaDoc,Groovydoc].each{ Class docClass -> + tasks.withType(docClass).each { docTask -> + docTasks[docTask.name] = docTask + processGhPages.dependsOn(docTask) + } +} + +githubPages { + repoUri = "[email protected]:Netflix/${rootProject.githubProjectName}.git" + pages { + docTasks.each { shortName, docTask -> + from(docTask.outputs.files) { + into "docs/${shortName}" + } + } + } +} +*/ + +wrapper { + gradleVersion = '1.10' +} |