-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: fixed root project name * chore: clean build.gradle, prepare for github packages, adjust to latest format * style: back to aosp 1.1 format rules * fix: parameter passing * chore: github action to test against multiple java-versions * chore: github action for publish package when tag release
- Loading branch information
Kristjan Kosic
authored
Feb 18, 2020
1 parent
b01d507
commit 2229ffc
Showing
20 changed files
with
416 additions
and
448 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Publish Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
|
||
- name: Build with Gradle | ||
run: gradle build | ||
|
||
- name: Publish to GitHub Packages | ||
run: gradle publish | ||
env: | ||
USERNAME: ${{ github.actor }} | ||
PASSWORD: ${{ secrets.GITHUB_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,128 +1,41 @@ | ||
buildscript { | ||
dependencies { | ||
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.27.1" | ||
} | ||
} | ||
|
||
plugins { | ||
id 'java' | ||
id 'maven' | ||
id 'maven-publish' | ||
id 'signing' | ||
id 'jacoco' | ||
id 'com.diffplug.gradle.spotless' version '3.27.1' | ||
} | ||
|
||
apply plugin:'java' | ||
apply plugin:'maven' | ||
apply plugin:'maven-publish' | ||
apply plugin: com.diffplug.gradle.spotless.SpotlessPlugin | ||
|
||
repositories { | ||
jcenter() | ||
mavenCentral() | ||
} | ||
|
||
task fatJar(type: Jar) { | ||
manifest.from jar.manifest | ||
classifier = 'standalone' | ||
from { | ||
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } | ||
} { | ||
exclude "META-INF/*.SF" | ||
exclude "META-INF/*.DSA" | ||
exclude "META-INF/*.RSA" | ||
} | ||
with jar | ||
} | ||
|
||
task javadocJar(type: Jar) { | ||
classifier = 'javadoc' | ||
from javadoc | ||
} | ||
|
||
task sourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
|
||
artifacts { | ||
archives javadocJar, sourcesJar | ||
} | ||
|
||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
|
||
repository(url: "file://${buildDir}/repo") {} | ||
|
||
//repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") { | ||
// authentication(userName: '', password: '') | ||
// } | ||
|
||
// snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { | ||
// authentication(userName: ossrhUsername, password: ossrhPassword) | ||
// } | ||
|
||
pom.project { | ||
groupId = 'org.arkecosystem' | ||
version = '1.0.0' | ||
artifactId = 'client' | ||
|
||
name = 'java-client' | ||
description = 'A simple Java API client for the ARK Blockchain.' | ||
url = 'https://github.com/ArkEcosystem/java-client' | ||
inceptionYear = '2018' | ||
|
||
licenses { | ||
license { | ||
name = 'MIT' | ||
distribution = 'repo' | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
name = 'Brian Faust' | ||
email = '[email protected]' | ||
organization = 'Ark Ecosystem' | ||
organizationUrl = 'https://ark.io' | ||
} | ||
developer { | ||
name = 'Joshua Noack' | ||
email = '[email protected]' | ||
organization = 'Ark Ecosystem' | ||
organizationUrl = 'https://ark.io' | ||
} | ||
developer { | ||
name = 'Kristjan Kosic' | ||
email = '[email protected]' | ||
organization = 'Ark Ecosystem' | ||
organizationUrl = 'https://ark.io' | ||
} | ||
developer { | ||
name = 'Zan Kovac' | ||
email = '[email protected]' | ||
organization = 'Ark Ecosystem' | ||
organizationUrl = 'https://ark.io' | ||
} | ||
} | ||
|
||
scm { | ||
connection = 'scm:git:git://github.com/ArkEcosystem/java-client.git' | ||
developerConnection = 'scm:git:ssh://github.com:ArkEcosystem/java-client.git' | ||
url = 'https://github.com/ArkEcosystem/java-client/tree/1.0.0' | ||
group = 'org.arkecosystem' | ||
version = '1.0.1' | ||
|
||
publishing { | ||
publishing { | ||
repositories { | ||
maven { | ||
name = "github" | ||
url = uri("https://maven.pkg.github.com/arkecosystem/java-client") | ||
credentials { | ||
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME") | ||
password = project.findProperty("gpr.key") ?: System.getenv("PASSWORD") | ||
} | ||
} | ||
} | ||
publications { | ||
gpr(MavenPublication) { | ||
from(components.java) | ||
} | ||
} | ||
} | ||
} | ||
|
||
if (project.hasProperty("signing.keyId")) { | ||
apply plugin:'signing' | ||
|
||
signing { | ||
sign configurations.archives | ||
javadoc { | ||
if (JavaVersion.current().isJava9Compatible()) { | ||
options.addBooleanOption('html5', true) | ||
} | ||
} | ||
} | ||
|
||
|
@@ -151,7 +64,7 @@ jacocoTestReport { | |
} | ||
|
||
wrapper { | ||
gradleVersion = '5.6.2' | ||
gradleVersion = '6.2.0' | ||
} | ||
|
||
spotless { | ||
|
@@ -160,12 +73,35 @@ spotless { | |
include 'src/main/**/*.java' | ||
exclude '**/build/**' | ||
} | ||
googleJavaFormat() | ||
googleJavaFormat('1.1').aosp() | ||
removeUnusedImports() | ||
|
||
} | ||
} | ||
|
||
task formatCode(dependsOn: ['spotlessApply']) | ||
|
||
task fatJar(type: Jar) { | ||
manifest.from jar.manifest | ||
classifier = 'standalone' | ||
from { | ||
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } | ||
} { | ||
exclude "META-INF/*.SF" | ||
exclude "META-INF/*.DSA" | ||
exclude "META-INF/*.RSA" | ||
} | ||
with jar | ||
} | ||
|
||
task javadocJar(type: Jar) { | ||
classifier = 'javadoc' | ||
from javadoc | ||
} | ||
|
||
task sourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
|
||
build.dependsOn 'spotlessApply' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
rootProject.name = 'arkecosystem-client' | ||
rootProject.name = 'java-client' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.