Skip to content

Commit 756497d

Browse files
committed
Publish to Bintray
1 parent c3d9df7 commit 756497d

File tree

5 files changed

+99
-3
lines changed

5 files changed

+99
-3
lines changed

.github/workflows/release.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types:
6+
- prereleased
7+
- released
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-18.04
12+
steps:
13+
- uses: actions/checkout@v1
14+
- name: Set up JDK
15+
uses: actions/setup-java@v1
16+
with:
17+
java-version: 14
18+
- name: Deploy with Gradle
19+
env:
20+
GRADLE_PUBLISH_REPO_URL: ${{ secrets.GRADLE_PUBLISH_REPO_URL }}
21+
GRADLE_PUBLISH_MAVEN_USER: ${{ secrets.GRADLE_PUBLISH_MAVEN_USER }}
22+
GRADLE_PUBLISH_MAVEN_PASSWORD: ${{ secrets.GRADLE_PUBLISH_MAVEN_PASSWORD }}
23+
run: ./gradlew --no-daemon -Pversion=$(git tag --points-at HEAD) publish

build.gradle

+16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
subprojects {
2+
apply from: "$rootDir/gradle/publishing.gradle"
3+
24
group = 'com.github.bsideup.jabel'
35
repositories {
46
jcenter()
57
}
8+
9+
plugins.withType(MavenPublishPlugin) {
10+
project.publishing {
11+
repositories {
12+
maven {
13+
url System.getenv('GRADLE_PUBLISH_REPO_URL')
14+
credentials {
15+
username = System.getenv('GRADLE_PUBLISH_MAVEN_USER')
16+
password = System.getenv('GRADLE_PUBLISH_MAVEN_PASSWORD')
17+
}
18+
}
19+
}
20+
}
21+
}
622
}

gradle/publishing.gradle

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
plugins.withType(MavenPublishPlugin) {
2+
project.publishing {
3+
publications {
4+
mavenJava(MavenPublication) { publication ->
5+
pom {
6+
description = 'Jabel - use modern Java 9-14 syntax when targeting Java 8.'
7+
name = project.description ?: description
8+
url = 'https://github.com/bsideup/jabel'
9+
licenses {
10+
license {
11+
name = 'Apache License, Version 2.0'
12+
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
13+
distribution = 'repo'
14+
}
15+
}
16+
scm {
17+
url = 'https://github.com/bsideup/jabel/'
18+
connection = 'scm:git:git://github.com/bsideup/jabel.git'
19+
developerConnection = 'scm:git:ssh://[email protected]/bsideup/jabel.git'
20+
}
21+
developers {
22+
developer {
23+
id = 'bsideup'
24+
name = 'Sergei Egorov'
25+
26+
}
27+
}
28+
}
29+
}
30+
}
31+
}
32+
}

jabel-javac-plugin/build.gradle

+26-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,36 @@
11
plugins {
22
id "java"
3-
id "maven"
3+
id "maven-publish"
44
}
55

66
sourceCompatibility = targetCompatibility = 8
77

88
dependencies {
99
compile 'net.bytebuddy:byte-buddy:1.10.14'
1010
compile 'net.bytebuddy:byte-buddy-agent:1.10.14'
11+
}
12+
13+
14+
task sourcesJar(type: Jar) {
15+
classifier 'sources'
16+
from sourceSets.main.allJava
17+
}
18+
19+
javadoc {
20+
options.source = "8"
21+
}
22+
23+
task javadocJar(type: Jar) {
24+
from javadoc
25+
classifier = 'javadoc'
26+
}
27+
28+
publishing {
29+
publications {
30+
mavenJava(MavenPublication) { publication ->
31+
from components.java
32+
artifact sourcesJar
33+
artifact javadocJar
34+
}
35+
}
1136
}

jabel-javac-plugin/src/main/java/com/github/bsideup/jabel/CheckSourceLevelAdvice.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
import com.sun.tools.javac.code.Source.Feature;
55
import net.bytebuddy.asm.Advice;
66

7-
public class CheckSourceLevelAdvice {
7+
class CheckSourceLevelAdvice {
88

99
@Advice.OnMethodEnter
10-
public static void checkSourceLevel(
10+
static void checkSourceLevel(
1111
@Advice.Argument(value = 1, readOnly = false) Feature feature
1212
) {
1313
if (feature.allowedInSource(Source.JDK8)) {

0 commit comments

Comments
 (0)