Skip to content

Commit

Permalink
Prepare 0.1 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira committed Oct 18, 2014
1 parent 7cc183c commit e5f7db2
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
81 changes: 78 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -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://[email protected]/mark-vieira/gradle-maven-settings-plugin.git')
}

asNode().appendNode('developers').appendNode('developer').with {
appendNode('id', 'mark-vieira')
appendNode('name', 'Mark Vieira')
appendNode('email', '[email protected]')
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}"]
}
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
group=net.linguica.gradle
version=0.1-SNAPSHOT
version=0.1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import org.gradle.mvn3.org.apache.maven.settings.building.SettingsBuildingExcept

public class MavenSettingsPlugin implements Plugin<Project> {
public static final String MAVEN_SETTINGS_EXTENSION_NAME = "mavenSettings"

private Settings settings

@Override
Expand Down Expand Up @@ -77,7 +78,7 @@ public class MavenSettingsPlugin implements Plugin<Project> {
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())
}
}
}
Expand Down

0 comments on commit e5f7db2

Please sign in to comment.