Skip to content

Commit 526a9c7

Browse files
committed
feat: reintroduced maven central for distribution.
1 parent d5799dc commit 526a9c7

File tree

3 files changed

+90
-20
lines changed

3 files changed

+90
-20
lines changed

.github/workflows/build-test-gumtree.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: actions/checkout@v2
2222
- name: retrieve gumtree version
2323
id: version
24-
run: echo "::set-output name=version::$(cat build.gradle | grep "version =" | cut -f 2 -d "'")"
24+
run: echo "::set-output name=version::$(cat build.gradle | grep "projectsVersion =" | cut -f 2 -d "'")"
2525
shell: bash
2626
- name: build gumtree
2727
run: ./gradlew build :benchmark:computeResults :benchmark:testSizeRegressions :benchmark:plotResults
@@ -41,12 +41,16 @@ jobs:
4141
if: ${{ github.event_name == 'schedule' && contains(steps.version.outputs.version, 'SNAPSHOT') }}
4242
run: ./gradlew publish
4343
env:
44-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME }}
45+
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD }}
4546
- name: upload release package
4647
if: ${{ github.event_name == 'push' && !contains(steps.version.outputs.version, 'SNAPSHOT') && endsWith(github.ref, steps.version.outputs.version) }}
47-
run: ./gradlew publish
48+
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
4849
env:
49-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME }}
51+
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD }}
52+
ORG_GRADLE_PROJECT_gumtreeKey: ${{ secrets.GUMTREE_KEY }}
53+
ORG_GRADLE_PROJECT_gumtreeKeyPassphrase: ${{ secrets.GUMTREE_KEY_PASSPHRASE }}
5054
- name: create github release
5155
if: ${{ github.event_name == 'push' && !contains(steps.version.outputs.version, 'SNAPSHOT') && endsWith(github.ref, steps.version.outputs.version) }}
5256
uses: ncipollo/release-action@v1

build.gradle

Lines changed: 81 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
plugins {
22
id 'jacoco'
3+
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
34
}
45

6+
nexusPublishing {
7+
repositories {
8+
sonatype()
9+
}
10+
}
11+
12+
def projectsVersion = '3.0.0'
13+
def isReleaseVersion = !projectsVersion.endsWith("SNAPSHOT")
14+
515
allprojects {
616
apply plugin: 'idea'
717

818
group = 'com.github.gumtreediff'
9-
version = '3.0.0-SNAPSHOT'
19+
version = projectsVersion
1020

1121
repositories {
1222
mavenCentral()
1323
}
1424
}
1525

16-
ext.isRelease = !project.version.endsWith("SNAPSHOT")
17-
1826
subprojects {
1927
apply plugin: 'java'
2028
sourceCompatibility = '11'
@@ -28,6 +36,7 @@ subprojects {
2836
withJavadocJar()
2937
withSourcesJar()
3038
}
39+
3140
javadoc {
3241
options.addBooleanOption('html5', true)
3342
}
@@ -124,26 +133,83 @@ task jacocoRootReport(type: JacocoReport, group: 'Coverage reports') {
124133
}
125134
}
126135

136+
def projectDescriptions = [
137+
client: 'GumTree abstract client module.',
138+
'client.diff': 'GumTree diff client.',
139+
core: 'GumTree core module.', 'gen.antlr3': 'GumTree abstract AntLR module.',
140+
'gen.antlr3-antlr': 'GumTree tree generator for AntLR grammars (AntLR based)',
141+
'gen.antlr3-json': 'GumTree tree generator for JSON code (AntLR based).',
142+
'gen.antlr3-php': 'GumTree tree generator for PHP code (AntLR based).',
143+
'gen.antlr3-r': 'GumTree tree generator for R code (AntLR based).',
144+
'gen.antlr3-xml': 'GumTree tree generator for XML code (AntLR based).',
145+
'gen.antlr4': 'GumTree abstract AntLR4 module.',
146+
'gen.antlr4-matlab': 'GumTree abstract AntLR4 module.',
147+
'gen.c': 'GumTree tree generator for C code. Requires cgum.',
148+
'gen.css': 'GumTree tree generator for CSS code based on ph-css.',
149+
'gen.javaparser': 'GumTree tree generator for Java code (JavaParser based).',
150+
'gen.jdt': 'GumTree tree generator for Java code (Eclipse JDT based).',
151+
'gen.js': 'GumTree tree generator for JavaScript code (Rhino based).',
152+
'gen.python': 'GumTree tree generator for Python. Requires pythonparser.',
153+
'gen.ruby': 'GumTree tree generator for Ruby code (JRuby based).',
154+
'gen.srcml': 'GumTree tree generator for C/C++, C# and Java code. Requires srcml.',
155+
]
156+
127157
configure(subprojects.findAll { !(it.name in ['dist', 'benchmark']) }) { subproject ->
128158
apply plugin: "maven-publish"
159+
apply plugin: "signing"
129160

130-
publishing {
131-
repositories {
132-
maven {
133-
name = "GitHubPackages"
134-
url = uri("https://maven.pkg.github.com/GumTreeDiff/gumtree")
135-
credentials {
136-
username = project.findProperty("gpr.actor") ?: System.getenv("GITHUB_ACTOR")
137-
password = project.findProperty("gpr.token") ?: System.getenv("GITHUB_TOKEN")
138-
}
139-
}
140-
}
161+
publishing {
141162
publications {
142-
gpr(MavenPublication) {
163+
gumtreeDist(MavenPublication) {
143164
from(components.java)
165+
166+
pom {
167+
name = "GumTree ${subproject.name}"
168+
description = projectDescriptions[subproject.name]
169+
url = 'https://github.com/GumTreeDiff/gumtree/'
170+
171+
scm {
172+
connection = 'scm:git:https://github.com/GumTreeDiff/gumtree/'
173+
developerConnection = 'scm:git:https://github.com/GumTreeDiff/gumtree/'
174+
url = 'https://github.com/GumTreeDiff/gumtree/'
175+
}
176+
177+
licenses {
178+
license {
179+
name = 'GNU Lesser General Public License v3.0'
180+
url = 'h ttps://www.gnu.org/copyleft/lesser.html'
181+
}
182+
}
183+
184+
developers {
185+
developer {
186+
id = 'jre'
187+
name = 'Jean-Rémy Falleri'
188+
email = 'jr.falleri@gmail.com'
189+
}
190+
191+
developer {
192+
id = 'flop'
193+
name = 'Floréal Morandat'
194+
email = 'florealm@gmail.com'
195+
}
196+
197+
developer {
198+
id = 'matias'
199+
name = 'Matias Martinez'
200+
email = 'matias.sebastian.martinez@gmail.com'
201+
}
202+
}
203+
}
144204
}
145205
}
146206
}
207+
208+
signing {
209+
required { isReleaseVersion }
210+
useInMemoryPgpKeys(findProperty("gumtreeKey"), findProperty("gumtreeKeyPassphrase"))
211+
sign publishing.publications.gumtreeDist
212+
}
147213
}
148214

149215
evaluationDependsOnChildren()

client.diff/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
description = 'GumTree diff client'
1+
description = 'GumTree diff client.'
22

33
dependencies {
44
implementation project(':client')

0 commit comments

Comments
 (0)