diff options
author | Mark Perry <maperry78@yahoo.com.au> | 2015-09-20 19:39:13 +1000 |
---|---|---|
committer | Mark Perry <maperry78@yahoo.com.au> | 2015-09-20 19:39:13 +1000 |
commit | e1004a918adab604d5fe88e1412016a63d2881d9 (patch) | |
tree | c9bf9d6fe9228a8f5db8e36f04cabc39d4c2de60 | |
parent | ec33f0c4812af193b6be0fd776d850d28166c293 (diff) | |
download | frege-gradle-plugin-e1004a918adab604d5fe88e1412016a63d2881d9.tar.gz frege-gradle-plugin-e1004a918adab604d5fe88e1412016a63d2881d9.tar.bz2 frege-gradle-plugin-e1004a918adab604d5fe88e1412016a63d2881d9.zip |
Enable snapshot sonatype releases
-rw-r--r-- | README.adoc | 6 | ||||
-rw-r--r-- | build.gradle | 4 | ||||
-rw-r--r-- | gradle.properties | 6 | ||||
-rw-r--r-- | gradle/sonatype.gradle | 98 |
4 files changed, 112 insertions, 2 deletions
diff --git a/README.adoc b/README.adoc index ff70bf5..0c2f162 100644 --- a/README.adoc +++ b/README.adoc @@ -17,4 +17,8 @@ See https://plugins.gradle.org/plugin/org.frege-lang = Continuous Integration -The Travis CI build of this repository is at https://travis-ci.org/Frege/frege-gradle-plugin.
\ No newline at end of file +The Travis CI build of this repository is at https://travis-ci.org/Frege/frege-gradle-plugin. + += Snapshots + +Snapshot releases are available from the Sonatype repository at https://oss.sonatype.org/content/groups/public/org/frege-lang. diff --git a/build.gradle b/build.gradle index 9986268..25a7779 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,7 @@ + apply plugin: "groovy" apply plugin: "maven" +apply plugin: "signing" defaultTasks "build" @@ -42,6 +44,8 @@ ext { } else println "cannot find '$propfile.absolutePath'" } +apply from: "gradle/sonatype.gradle" + version = projectVersion group = projectGroup diff --git a/gradle.properties b/gradle.properties index f60ca17..7349a1d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,5 @@ -#currently not needed
\ No newline at end of file +#currently not needed + +signingEnabled = false +sonatypeUsername = incorrectUsername +sonatypePassword = incorrectPassword diff --git a/gradle/sonatype.gradle b/gradle/sonatype.gradle new file mode 100644 index 0000000..adae7e6 --- /dev/null +++ b/gradle/sonatype.gradle @@ -0,0 +1,98 @@ + +ext { + + sonatypeBaseUrl = "https://oss.sonatype.org" + sonatypeSnapshotUrl = "$sonatypeBaseUrl/content/repositories/snapshots/" + sonatypeRepositoryUrl = "$sonatypeBaseUrl/content/groups/public" + sonatypeReleaseUrl = "$sonatypeBaseUrl/service/local/staging/deploy/maven2/" + sonatypeUploadUrl = isSnapshot ? sonatypeSnapshotUrl : sonatypeReleaseUrl + + projectUrl = "https://github.com/Frege/frege-gradle-plugin" + projectName = "Frege Gradle Plugin" + pomProjectName = projectName + baseJarName = "gradle-frege-plugin" + + groupName = "org.frege-lang" + scmUrl = "git://github.com/Frege/frege-gradle-plugin.git" + scmGitFile = "scm:git@github.com:Frege/frege-gradle-plugin.git" + projectDescription = "Frege Gradle plugin" + + licenseName = "BSD 3-clause license" + licenseUrl = 'http://opensource.org/licenses/BSD-3-Clause' + + organisation = groupName + + primaryEmail = "frege-programming-language@googlegroups.com" +} + +Boolean doSigning() { + + signingEnabled.trim() == "true" +} + +task javadocJar(type: Jar, dependsOn: "javadoc") { + classifier = 'javadoc' + from "build/docs/javadoc" +} + +task sourcesJar(type: Jar) { + from sourceSets.main.allSource + classifier = 'sources' +} + +artifacts { + archives jar + archives javadocJar + + archives sourcesJar +} + +signing { + required { doSigning() } + sign configurations.archives +} + +uploadArchives { + enabled = true + repositories { + mavenDeployer { + if (doSigning()) { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + } + + + repository(url: sonatypeUploadUrl) { + authentication(userName: sonatypeUsername, password: sonatypePassword) + } + pom { + groupId = groupName + project { + name pomProjectName + packaging 'jar' + description projectDescription + url projectUrl + organization { + name pomProjectName + url projectUrl + } + scm { + url scmUrl + } + licenses { + license { + name licenseName + url licenseUrl + distribution 'repo' + } + } + developers { + developer { + email primaryEmail + } + } + } + } + } + } +} + |