Skip to content

Commit

Permalink
Publish to Bintray
Browse files Browse the repository at this point in the history
  • Loading branch information
bsideup committed Sep 12, 2020
1 parent c3d9df7 commit 756497d
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 3 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release

on:
release:
types:
- prereleased
- released

jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 14
- name: Deploy with Gradle
env:
GRADLE_PUBLISH_REPO_URL: ${{ secrets.GRADLE_PUBLISH_REPO_URL }}
GRADLE_PUBLISH_MAVEN_USER: ${{ secrets.GRADLE_PUBLISH_MAVEN_USER }}
GRADLE_PUBLISH_MAVEN_PASSWORD: ${{ secrets.GRADLE_PUBLISH_MAVEN_PASSWORD }}
run: ./gradlew --no-daemon -Pversion=$(git tag --points-at HEAD) publish
16 changes: 16 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
subprojects {
apply from: "$rootDir/gradle/publishing.gradle"

group = 'com.github.bsideup.jabel'
repositories {
jcenter()
}

plugins.withType(MavenPublishPlugin) {
project.publishing {
repositories {
maven {
url System.getenv('GRADLE_PUBLISH_REPO_URL')
credentials {
username = System.getenv('GRADLE_PUBLISH_MAVEN_USER')
password = System.getenv('GRADLE_PUBLISH_MAVEN_PASSWORD')
}
}
}
}
}
}
32 changes: 32 additions & 0 deletions gradle/publishing.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
plugins.withType(MavenPublishPlugin) {
project.publishing {
publications {
mavenJava(MavenPublication) { publication ->
pom {
description = 'Jabel - use modern Java 9-14 syntax when targeting Java 8.'
name = project.description ?: description
url = 'https://github.com/bsideup/jabel'
licenses {
license {
name = 'Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
scm {
url = 'https://github.com/bsideup/jabel/'
connection = 'scm:git:git://github.com/bsideup/jabel.git'
developerConnection = 'scm:git:ssh://[email protected]/bsideup/jabel.git'
}
developers {
developer {
id = 'bsideup'
name = 'Sergei Egorov'
email = '[email protected]'
}
}
}
}
}
}
}
27 changes: 26 additions & 1 deletion jabel-javac-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
plugins {
id "java"
id "maven"
id "maven-publish"
}

sourceCompatibility = targetCompatibility = 8

dependencies {
compile 'net.bytebuddy:byte-buddy:1.10.14'
compile 'net.bytebuddy:byte-buddy-agent:1.10.14'
}


task sourcesJar(type: Jar) {
classifier 'sources'
from sourceSets.main.allJava
}

javadoc {
options.source = "8"
}

task javadocJar(type: Jar) {
from javadoc
classifier = 'javadoc'
}

publishing {
publications {
mavenJava(MavenPublication) { publication ->
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import com.sun.tools.javac.code.Source.Feature;
import net.bytebuddy.asm.Advice;

public class CheckSourceLevelAdvice {
class CheckSourceLevelAdvice {

@Advice.OnMethodEnter
public static void checkSourceLevel(
static void checkSourceLevel(
@Advice.Argument(value = 1, readOnly = false) Feature feature
) {
if (feature.allowedInSource(Source.JDK8)) {
Expand Down

0 comments on commit 756497d

Please sign in to comment.