From e5f7db2d85c04e22644e3ee02f1209be02079195 Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Sat, 18 Oct 2014 13:37:53 -0600 Subject: [PATCH] Prepare 0.1 release. --- README.md | 2 +- build.gradle | 81 ++++++++++++++++++- gradle.properties | 2 +- .../maven/settings/MavenSettingsPlugin.groovy | 3 +- 4 files changed, 82 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index efecda9..45ee164 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This Gradle plugin provides a migration path for projects coming from a Maven ecosystem. It exposes standard Maven configuration located in [settings files](http://maven.apache.org/settings.htm) to your Gradle project. This allows -projects to continue to leverage functionality provided by Maven such as profiles and mirrors as well use existing +projects to continue to leverage functionality provided by Maven such as mirrors as well use existing settings configuration to store encrypted repository authentication credentials. ## Mirrors diff --git a/build.gradle b/build.gradle index 6882c86..22bf7f3 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,9 @@ -apply plugin: 'java-gradle-plugin' -apply plugin: 'groovy' -apply plugin: 'maven' +plugins { + id 'java-gradle-plugin' + id 'groovy' + id 'maven-publish' + id 'com.jfrog.bintray' version '0.6' +} repositories { mavenCentral() @@ -13,3 +16,75 @@ dependencies { sourceCompatibility = '1.6' targetCompatibility = '1.6' + +task sourcesJar(type: Jar) { + classifier 'sources' + from sourceSets.main.allSource +} + +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + artifact sourcesJar + + pom.withXml { + asNode().with { + appendNode('name', 'Gradle Maven settings plugin') + appendNode('description', 'Gradle plugin for exposing Maven settings file configuration to Gradle project.') + appendNode('url', 'https://github.com/mark-vieira/gradle-maven-settings-plugin') + appendNode('inceptionYear', '2014') + } + + asNode().appendNode('licenses').appendNode('license').with { + appendNode('name', 'The Apache Software License, Version 2.0') + appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0.txt') + appendNode('distribution', 'repo') + } + + asNode().appendNode('scm').with { + appendNode('url', 'https://github.com/mark-vieira/gradle-maven-settings-plugin') + appendNode('connection', 'scm:git:https://github.com/mark-vieira/gradle-maven-settings-plugin.git') + appendNode('developerConnection', 'scm:git:https://mark-vieira@github.com/mark-vieira/gradle-maven-settings-plugin.git') + } + + asNode().appendNode('developers').appendNode('developer').with { + appendNode('id', 'mark-vieira') + appendNode('name', 'Mark Vieira') + appendNode('email', 'portugee@gmail.com') + appendNode('url', 'https://github.com/mark-vieira') + } + + asNode().appendNode('issueManagement').with { + appendNode('system', 'GitHub') + appendNode('url', 'https://github.com/mark-vieira/gradle-maven-settings-plugin/issues') + } + } + } + } +} + +bintray { + user = project.hasProperty('bintrayUser') ? bintrayUser : null + key = project.hasProperty('bintrayApiKey') ? bintrayApiKey : null + + publications = ['mavenJava'] + + pkg { + repo = 'maven' + name = 'gradle-maven-settings-plugin' + desc = 'Gradle plugin for exposing Maven settings file configuration to Gradle project.' + websiteUrl = 'https://github.com/mark-vieira/gradle-maven-settings-plugin' + issueTrackerUrl = 'https://github.com/mark-vieira/gradle-maven-settings-plugin/issues' + vcsUrl = 'https://github.com/mark-vieira/gradle-maven-settings-plugin.git' + licenses = ['Apache-2.0'] + labels = ['gradle', 'maven', 'settings'] + publicDownloadNumbers = true + + version { + name = project.version + vcsTag = project.version + attributes = ['gradle-plugin': "net.linguica.maven-settings:${project.group}:${project.name}"] + } + } +} diff --git a/gradle.properties b/gradle.properties index 9f372b4..8c0c16d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ group=net.linguica.gradle -version=0.1-SNAPSHOT +version=0.1 diff --git a/src/main/groovy/net/linguica/gradle/maven/settings/MavenSettingsPlugin.groovy b/src/main/groovy/net/linguica/gradle/maven/settings/MavenSettingsPlugin.groovy index b5359eb..3d82461 100644 --- a/src/main/groovy/net/linguica/gradle/maven/settings/MavenSettingsPlugin.groovy +++ b/src/main/groovy/net/linguica/gradle/maven/settings/MavenSettingsPlugin.groovy @@ -29,6 +29,7 @@ import org.gradle.mvn3.org.apache.maven.settings.building.SettingsBuildingExcept public class MavenSettingsPlugin implements Plugin { public static final String MAVEN_SETTINGS_EXTENSION_NAME = "mavenSettings" + private Settings settings @Override @@ -77,7 +78,7 @@ public class MavenSettingsPlugin implements Plugin { project.logger.info "Found central mirror in settings.xml. Replacing Maven Central repository with " + "mirror located at ${centralMirror.url}" createMirrorRepository(project, centralMirror) { MavenArtifactRepository repo -> - repo.name == ArtifactRepositoryContainer.DEFAULT_MAVEN_CENTRAL_REPO_NAME + ArtifactRepositoryContainer.MAVEN_CENTRAL_URL.startsWith(repo.url.toString()) } } }