forked from Netflix/archaius
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'build/multi-project'
Conflicts: build.gradle gradle/check.gradle gradle/convention.gradle gradle/maven.gradle settings.gradle
- Loading branch information
Showing
15 changed files
with
279 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,26 @@ | ||
// Establish version and status | ||
ext.releaseVersion = '0.5.2' | ||
ext.githubProjectName = 'archaius' | ||
//group = 'com.netflix.archaius' | ||
ext.githubProjectName = rootProject.name // Change if github project name is not the same as the root project's name | ||
|
||
buildscript { | ||
repositories { mavenCentral() } | ||
apply from: file('gradle/buildscript.gradle'), to: buildscript | ||
} | ||
|
||
allprojects { | ||
repositories { mavenCentral() } | ||
} | ||
|
||
//apply from: file('gradle/release.gradle') // Not fully tested | ||
apply from: file('gradle/convention.gradle') | ||
apply from: file('gradle/maven.gradle') | ||
apply from: file('gradle/check.gradle') | ||
//apply from: file('gradle/license.gradle') // Waiting for re-release | ||
apply from: file('gradle/license.gradle') | ||
apply from: file('gradle/release.gradle') | ||
|
||
subprojects { | ||
// Closure to configure all the POM with extra info, common to all projects | ||
pom { | ||
project { | ||
url "https://github.com/Netflix/${githubProjectName}" | ||
scm { | ||
connection "scm:git:[email protected]:Netflix/${githubProjectName}.git" | ||
url "scm:git:[email protected]:Netflix/${githubProjectName}.git" | ||
developerConnection "scm:git:[email protected]:Netflix/${githubProjectName}.git" | ||
} | ||
issueManagement { | ||
system 'github' | ||
url "https://github.com/Netflix/${githubProjectName}/issues" | ||
} | ||
} | ||
} | ||
group = "com.netflix.${githubProjectName}" // TEMPLATE: Set to organization of project | ||
} | ||
group = "com.netflix.${githubProjectName}" | ||
|
||
task javadoc(type: Javadoc) { | ||
source subprojects.collect { project -> | ||
project.sourceSets.main.allJava | ||
} | ||
destinationDir = new File(buildDir, 'javadoc') | ||
// Might need a classpath | ||
classpath = files(subprojects.collect { project -> | ||
project.sourceSets.main.compileClasspath | ||
}) | ||
apply plugin: 'java' | ||
tasks.withType(Test) { forkEvery = 1 } | ||
} | ||
|
||
project(':archaius-core') { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
version=0.5.2-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Executed in context of buildscript | ||
repositories { | ||
// Repo in addition to maven central | ||
maven { | ||
name 'build-repo' | ||
url 'https://raw.github.com/Netflix-Skunkworks/build-repo/master/releases/' // gradle-release/gradle-release/1.0-SNAPSHOT/gradle-release-1.0-SNAPSHOT.jar | ||
} | ||
} | ||
dependencies { | ||
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.6.0' | ||
classpath 'com.mapvine:gradle-cobertura-plugin:0.1' | ||
classpath 'gradle-release:gradle-release:1.0-SNAPSHOT' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,30 @@ | ||
subprojects { | ||
/* | ||
// Checkstyle | ||
apply plugin: 'checkstyle' | ||
tasks.withType(Checkstyle) { ignoreFailures = true } | ||
checkstyle { | ||
ignoreFailures = true // Waiting on GRADLE-2163 | ||
configFile = rootProject.file('codequality/checkstyle.xml') | ||
}*/ | ||
} | ||
*/ | ||
|
||
// FindBugs | ||
apply plugin: 'findbugs' | ||
tasks.withType(FindBugs) { | ||
reports.html.enabled true | ||
reports.html.enabled true | ||
reports.xml.enabled false | ||
} | ||
|
||
// PMD | ||
// apply plugin: 'pmd' | ||
// tasks.withType(Pmd) { ignoreFailures = true } | ||
|
||
apply plugin: 'java' | ||
tasks.withType(Test) { forkEvery = 1 } | ||
apply plugin: 'cobertura' | ||
cobertura { | ||
sourceDirs = sourceSets.main.java.srcDirs | ||
format = 'html' | ||
includes = ['**/*.java', '**/*.groovy'] | ||
excludes = [] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
buildscript { | ||
dependencies { classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.5' } | ||
} | ||
// Dependency for plugin was set in buildscript.gradle | ||
|
||
apply plugin: nl.javadude.gradle.plugins.license.LicensePlugin | ||
subprojects { | ||
apply plugin: 'license' //nl.javadude.gradle.plugins.license.LicensePlugin | ||
license { | ||
header rootProject.file('codequality/HEADER') | ||
ext.year = Calendar.getInstance().get(Calendar.YEAR) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,31 +3,24 @@ subprojects { | |
apply plugin: 'maven' // Java plugin has to have been already applied for the conf2scope mappings to work | ||
apply plugin: 'signing' | ||
|
||
if (gradle.startParameter.taskNames.contains("uploadMavenCentral")) { | ||
signing { | ||
required true | ||
sign configurations.archives | ||
} | ||
} else { | ||
task signArchives { | ||
// do nothing | ||
} | ||
signing { | ||
required { gradle.taskGraph.hasTask(uploadMavenCentral) } | ||
sign configurations.archives | ||
} | ||
|
||
/** | ||
* Publishing to Maven Central example provided from http://jedicoder.blogspot.com/2011/11/automated-gradle-project-deployment-to.html | ||
*/ | ||
task uploadMavenCentral(type:Upload) { | ||
task uploadMavenCentral(type:Upload, dependsOn: signArchives) { | ||
configuration = configurations.archives | ||
dependsOn 'signArchives' | ||
doFirst { | ||
repositories.mavenDeployer { | ||
beforeDeployment { org.gradle.api.artifacts.maven.MavenDeployment deployment -> signing.signPom(deployment) } | ||
|
||
// To test deployment locally, use the following instead of oss.sonatype.org | ||
//repository(url: "file://localhost/${rootProject.rootDir}/repo") | ||
|
||
repository(url: 'http://oss.sonatype.org/service/local/staging/deploy/maven2/') { | ||
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2') { | ||
authentication(userName: rootProject.sonatypeUsername, password: rootProject.sonatypePassword) | ||
} | ||
|
||
|
@@ -36,10 +29,14 @@ subprojects { | |
|
||
// Closure to configure all the POM with extra info, common to all projects | ||
pom.project { | ||
parent { | ||
groupId 'org.sonatype.oss' | ||
artifactId 'oss-parent' | ||
version '7' | ||
name "${project.name}" | ||
description "${project.name} developed by Netflix" | ||
developers { | ||
developer { | ||
id 'netflixgithub' | ||
name 'Netflix Open Source Development' | ||
email '[email protected]' | ||
} | ||
} | ||
licenses { | ||
license { | ||
|
@@ -48,6 +45,16 @@ subprojects { | |
distribution 'repo' | ||
} | ||
} | ||
url "https://github.com/Netflix/${rootProject.githubProjectName}" | ||
scm { | ||
connection "scm:git:[email protected]:Netflix/${rootProject.githubProjectName}.git" | ||
url "scm:git:[email protected]:Netflix/${rootProject.githubProjectName}.git" | ||
developerConnection "scm:git:[email protected]:Netflix/${rootProject.githubProjectName}.git" | ||
} | ||
issueManagement { | ||
system 'github' | ||
url "https://github.com/Netflix/${rootProject.githubProjectName}/issues" | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,65 @@ | ||
buildscript { | ||
dependencies { classpath group: 'no.entitas.gradle', name: 'gradle-release-plugin', version: '1.11' } | ||
apply plugin: 'release' | ||
|
||
// Ignore release plugin's task because it calls out via GradleBuild. This is a good place to put an email to send out | ||
task release(overwrite: true, dependsOn: commitNewVersion) << { | ||
// This is a good place to put an email to send out | ||
} | ||
commitNewVersion.dependsOn updateVersion | ||
updateVersion.dependsOn createReleaseTag | ||
createReleaseTag.dependsOn preTagCommit | ||
def buildTasks = tasks.matching { it.name =~ /:build/ } | ||
preTagCommit.dependsOn buildTasks | ||
preTagCommit.dependsOn checkSnapshotDependencies | ||
//checkSnapshotDependencies.dependsOn confirmReleaseVersion // Introduced in 1.0, forces readLine | ||
//confirmReleaseVersion.dependsOn unSnapshotVersion | ||
checkSnapshotDependencies.dependsOn unSnapshotVersion // Remove once above is fixed | ||
unSnapshotVersion.dependsOn checkUpdateNeeded | ||
checkUpdateNeeded.dependsOn checkCommitNeeded | ||
checkCommitNeeded.dependsOn initScmPlugin | ||
|
||
[ | ||
uploadIvyLocal: 'uploadLocal', | ||
uploadArtifactory: 'artifactoryPublish', // Call out to compile against internal repository | ||
buildWithArtifactory: 'build' // Build against internal repository | ||
].each { key, value -> | ||
// Call out to compile against internal repository | ||
task "${key}"(type: GradleBuild) { | ||
startParameter = project.gradle.startParameter.newInstance() | ||
startParameter.addInitScript( file('gradle/netflix-oss.gradle') ) | ||
startParameter.getExcludedTaskNames().add('check') | ||
tasks = [ 'build', value ] | ||
} | ||
} | ||
task releaseArtifactory(dependsOn: [checkSnapshotDependencies, uploadArtifactory]) | ||
|
||
// Ensure upload happens before taggging but after all pre-checks | ||
releaseArtifactory.dependsOn checkSnapshotDependencies | ||
createReleaseTag.dependsOn releaseArtifactory | ||
gradle.taskGraph.whenReady { taskGraph -> | ||
if ( taskGraph.hasTask(uploadArtifactory) && rootProject.status == 'release' && !taskGraph.hasTask(':release') ) { | ||
throw new GradleException('"release" task has to be run before uploading a release to Artifactory') | ||
} | ||
} | ||
subprojects.each { project -> | ||
project.uploadMavenCentral.dependsOn rootProject.checkSnapshotDependencies | ||
rootProject.createReleaseTag.dependsOn project.uploadMavenCentral | ||
|
||
gradle.taskGraph.whenReady { taskGraph -> | ||
if ( taskGraph.hasTask(project.uploadMavenCentral) && !taskGraph.hasTask(':release') ) { | ||
throw new GradleException('"release" task has to be run before uploading to Maven Central') | ||
} | ||
} | ||
} | ||
|
||
apply plugin: no.entitas.gradle.git.GitReleasePlugin // 'gitrelease' | ||
// Prevent plugin from asking for a version number interactively | ||
ext.'gradle.release.useAutomaticVersion' = "true" | ||
|
||
release { | ||
// http://tellurianring.com/wiki/gradle/release | ||
failOnCommitNeeded=true | ||
failOnPublishNeeded=true | ||
failOnUnversionedFiles=true | ||
failOnUpdateNeeded=true | ||
includeProjectNameInTag=true | ||
requireBranch = null | ||
} |
Binary file not shown.
Oops, something went wrong.