Skip to content

Commit f615971

Browse files
committed
First try in releasing to codemc
1 parent 41494a9 commit f615971

File tree

1 file changed

+32
-47
lines changed

1 file changed

+32
-47
lines changed

build.gradle

Lines changed: 32 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
plugins{
2-
id 'com.jfrog.bintray' version '1.8.5'
32
id 'java'
43
id 'java-library'
54
id 'idea'
65
id 'maven-publish'
76
id 'maven'
87
id 'com.github.johnrengelman.shadow' version '5.2.0'
8+
id 'signing'
99
}
1010

1111
def ver = new Version(major: 6, minor: 4, patch: 2)
@@ -98,38 +98,6 @@ allprojects {
9898
dependsOn { shadowJar }
9999
}
100100

101-
bintray {
102-
user = System.getenv("BintrayUser")
103-
key = System.getenv("BintrayApiKey")
104-
publications = ['BintrayRelease']
105-
publish = true
106-
pkg {
107-
repo = 'maven'
108-
name = 'JavaBotBlockAPI'
109-
licenses = ['MIT']
110-
vcsUrl = 'https://github.com/botblock/JavaBotBlockAPI'
111-
version {
112-
name = project.version
113-
released = new Date()
114-
vcsTag = System.getenv("VcsTag")
115-
}
116-
}
117-
}
118-
119-
bintrayUpload {
120-
dependsOn { rootProject.getTasksByName('build', true) }
121-
}
122-
123-
publishing {
124-
publications {
125-
BintrayRelease(MavenPublication) {
126-
it.groupId = project.group
127-
it.artifactId = project.artifactId
128-
it.version = project.version
129-
}
130-
}
131-
}
132-
133101
}
134102

135103
subprojects {
@@ -176,16 +144,6 @@ subprojects {
176144
destinationDirectory = file("$rootDir/build/libs/")
177145
}
178146

179-
publishing {
180-
publications {
181-
BintrayRelease(MavenPublication) {
182-
from components.java
183-
artifact javadocJar
184-
artifact sourceJar
185-
}
186-
}
187-
}
188-
189147
afterEvaluate {
190148
if(project.includeInParent) {
191149
rootProject.dependencies.compile project
@@ -227,14 +185,20 @@ task sourcesJar(type: Jar, dependsOn: classes){
227185

228186
publishing {
229187
publications {
230-
BintrayRelease(MavenPublication) {
188+
mavenJava(MavenPublication) {
189+
artifactId = "JavaBotBlockAPI"
190+
191+
from components.java
192+
artifact javadocJar
193+
artifact sourceJar
194+
231195
pom.withXml {
232196
def reposNode = asNode().appendNode('repositories')
233197
def repoNode = reposNode.appendNode('repository')
234198

235-
repoNode.appendNode('name', 'bintray')
236-
repoNode.appendNode('id', 'bintray-andre601-maven')
237-
repoNode.appendNode('url', 'https://dl.bintray.com/andre601/maven')
199+
repoNode.appendNode('name', 'codemc')
200+
repoNode.appendNode('id', 'codemc-andre601')
201+
repoNode.appendNode('url', 'https://repo.codemc.io/repository/maven-public/')
238202

239203
def dependenciesNode = asNode().appendNode('dependencies')
240204
configurations.compile.allDependencies.each {
@@ -248,6 +212,27 @@ publishing {
248212
}
249213
}
250214
}
215+
repositories {
216+
maven {
217+
url = "https://repo.codemc.io/repository/maven-releases/"
218+
219+
def mavenUsername = System.getenv("ORG_GRADLE_PROJECT_mavenUsername") ? System.getenv("ORG_GRADLE_PROJECT_mavenUsername") :
220+
System.getProperty("ORG_GRADLE_PROJECT_mavenUsername") ? System.getProperty("ORG_GRADLE_PROJECT_mavenUsername") : null
221+
def mavenPassword = System.getenv("ORG_GRADLE_PROJECT_mavenPassword") ? System.getenv("ORG_GRADLE_PROJECT_mavenPassword") :
222+
System.getProperty("ORG_GRADLE_PROJECT_mavenPassword") ? System.getProperty("ORG_GRADLE_PROJECT_mavenPassword") : null
223+
224+
if(mavenUsername != null && mavenPassword != null) {
225+
credentials {
226+
username = mavenUsername
227+
password = mavenPassword
228+
}
229+
}
230+
}
231+
}
232+
}
233+
234+
signing {
235+
sign publishing.publications.mavenJava
251236
}
252237

253238
class Version{

0 commit comments

Comments
 (0)