Skip to content

Commit 6d90582

Browse files
committed
Migrated publish to nexus logic to jdroid internal plugin
1 parent a381613 commit 6d90582

File tree

1 file changed

+3
-108
lines changed

1 file changed

+3
-108
lines changed

build.gradle

Lines changed: 3 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@ ext.VERSION_MAJOR = 0
22
ext.VERSION_MINOR = 9
33
ext.VERSION_PATCH = 2
44

5+
ext.JDROID_GITHUB_REPOSITORY_OWNER = 'maxirosson'
6+
ext.JDROID_GITHUB_REPOSITORY_NAME = 'jdroid-java-github'
7+
58
apply plugin: 'com.jdroid.java.library'
69
apply plugin: 'com.jdroid.component.builder'
710

8-
apply plugin: 'maven'
9-
apply plugin: 'signing'
10-
11-
ext.projectName = 'jdroid-java-github'
1211
description = 'Java Connector for GitHub API'
13-
group = 'com.jdroidframework'
14-
ext.packaging = jar
1512

1613
buildscript {
1714
repositories {
@@ -25,7 +22,6 @@ buildscript {
2522
}
2623
}
2724
dependencies {
28-
classpath 'com.jdroidframework:jdroid-java-github-connector:0.9.0'
2925
classpath 'com.jdroidframework:jdroid-gradle-plugin:0.9.6-SNAPSHOT'
3026
classpath 'com.jdroidframework:jdroid-internal:0.1.0-SNAPSHOT'
3127
}
@@ -38,104 +34,3 @@ repositories {
3834
dependencies {
3935
compile 'com.google.code.gson:gson:2.2.2'
4036
}
41-
42-
Boolean localUpload = getBooleanProp('LOCAL_UPLOAD', true)
43-
def localMavenRepo = getProp('LOCAL_MAVEN_REPO')
44-
45-
if (localUpload && localMavenRepo == null) {
46-
project.logger.warn("LOCAL_MAVEN_REPO property is not defined. Skipping uploadArchives configuration")
47-
} else {
48-
afterEvaluate {
49-
uploadArchives {
50-
repositories {
51-
mavenDeployer {
52-
53-
beforeDeployment { MavenDeployment deployment ->
54-
signing.signPom(deployment)
55-
}
56-
57-
if (localUpload) {
58-
repository(url: project.uri(localMavenRepo))
59-
} else {
60-
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
61-
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
62-
}
63-
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
64-
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
65-
}
66-
}
67-
68-
pom.project {
69-
name project.ext.projectName
70-
description project.description
71-
packaging project.packaging
72-
url 'http://www.jdroidframework.com'
73-
inceptionYear '2011'
74-
organization {
75-
name 'Jdroid'
76-
url 'http://www.jdroidframework.com'
77-
}
78-
licenses {
79-
license {
80-
name 'The Apache License, Version 2.0'
81-
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
82-
distribution 'repo'
83-
}
84-
}
85-
developers {
86-
developer {
87-
name 'Maxi Rosson'
88-
89-
roles {
90-
role 'architect'
91-
role 'developer'
92-
}
93-
}
94-
}
95-
scm {
96-
connection 'scm:git:[email protected]:maxirosson/jdroid-java-github.git'
97-
developerConnection 'scm:git:[email protected]:maxirosson/jdroid-java-github.git'
98-
url '[email protected]:maxirosson/jdroid-java-github.git'
99-
}
100-
issueManagement {
101-
system 'GitHub'
102-
url 'https://github.com/maxirosson/jdroid-java-github/issues'
103-
}
104-
}
105-
}
106-
}
107-
}
108-
}
109-
}
110-
111-
if (getBooleanProp('SIGNING_ENABLED', true)) {
112-
signing {
113-
required { !jdroid.isSnapshot && gradle.taskGraph.hasTask("uploadArchives") }
114-
sign configurations.archives
115-
}
116-
}
117-
118-
def getRepositoryUsername() {
119-
return getProp('JDROID_NEXUS_USERNAME')
120-
}
121-
122-
def getRepositoryPassword() {
123-
return getProp('JDROID_NEXUS_PASSWORD')
124-
}
125-
126-
public def getProp(String propertyName) {
127-
return project.hasProperty(propertyName) ? project.ext.get(propertyName) : System.getenv(propertyName)
128-
}
129-
130-
public Boolean getBooleanProp(String propertyName, Boolean defaultValue) {
131-
def value = getProp(propertyName)
132-
if (value == null) {
133-
return defaultValue
134-
} else if (value == 'true') {
135-
return true
136-
} else if (value == 'false') {
137-
return false
138-
} else {
139-
throw new GradleException('Invalid Boolean value: ' + value)
140-
}
141-
}

0 commit comments

Comments
 (0)