Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
name: Release
on:
push:
branches: [ main ]
branches: [ main, test_changes]
workflow_dispatch:

jobs:
Expand All @@ -35,8 +35,8 @@ jobs:
gpg --quiet --output $GITHUB_WORKSPACE/release.gpg --dearmor ./release.asc

SONATYPE_PASSWORD_ESCAPED=$(printf '%s\n' "$SONATYPE_PASSWORD" | sed -e 's/[\/&]/\\&/g')
sed -i -e "s,sonatypeUsername=,sonatypeUsername=$SONATYPE_USERNAME,g" gradle.properties
sed -i -e "s,sonatypePassword=,sonatypePassword=$SONATYPE_PASSWORD_ESCAPED,g" gradle.properties
sed -i -e "s,mavenCentralUsername=,mavenCentralUsername=$SONATYPE_USERNAME,g" gradle.properties
sed -i -e "s,mavenCentralPassword=,mavenCentralPassword=$SONATYPE_PASSWORD_ESCAPED,g" gradle.properties
sed -i -e "s,githubPassword=,githubPassword=$GITHUB_PASSWORD,g" gradle.properties
sed -i -e "s,signing.keyId=,signing.keyId=$GPG_KEY_ID,g" gradle.properties
sed -i -e "s,signing.password=,signing.password=$GPG_PASSWORD,g" gradle.properties
Expand Down
109 changes: 33 additions & 76 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

buildscript { // Configuration for building
repositories {
mavenCentral()
Expand All @@ -7,7 +8,7 @@ buildscript { // Configuration for building
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id "com.vanniktech.maven.publish" version "0.34.0"
}

apply plugin: 'java' // standard Java tasks
Expand All @@ -29,60 +30,45 @@ repositories { // repositories for Jar's you access in your code
mavenCentral()
}

publishing {
publications {
authLib(MavenPublication) {
pom {
name = 'Fleet Engine Auth Library'
description = 'Provides a set of tools to simplify the Fleet Engine setup process.'
url = 'https://github.com/googlemaps/java-fleetengine-auth'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
organization {
name = 'Google, Inc.'
url = 'http://www.google.com'
}
issueManagement {
system = 'GitHub Issues'
url = 'http://github.com/googlemaps/java-fleetengine-auth/issues'
}
scm {
connection = 'scm:git:git://github.com/googlemaps/java-fleetengine-auth.git'
developerConnection = 'scm:git:ssh://github.com/googlemaps/java-fleetengine-auth.git'
url = 'http://github.com/googlemaps/java-fleetengine-auth/'
tag = 'HEAD'
}
developers {
developer {
id = 'danielfbright'
name = 'Daniel Bright'
}
}
mavenPublishing {
publishToMavenCentral()
signAllPublications()
pom {
name = "Fleet Engine Auth Library"
description = "Provides a set of tools to simplify the Fleet Engine setup process."
url = "https://github.com/googlemaps/java-fleetengine-auth"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
groupId group
artifactId project.ext.artifactId
version version
from components.java
}
}
repositories {
maven {
name = "mavencentral"
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username sonatypeUsername
password sonatypePassword
organization {
name = 'Google, Inc.'
url = 'http://www.google.com'
}
issueManagement {
system = 'GitHub Issues'
url = 'http://github.com/googlemaps/java-fleetengine-auth/issues'
}
scm {
connection = 'scm:git:git://github.com/googlemaps/java-fleetengine-auth.git'
developerConnection = 'scm:git:ssh://github.com/googlemaps/java-fleetengine-auth.git'
url = 'http://github.com/googlemaps/java-fleetengine-auth/'
tag = 'HEAD'
}
developers {
developer {
id.set("google")
name.set("Google Inc.")
}
}
}
}

dependencies {
compile 'jstl:jstl:1.2'
implementation 'jstl:jstl:1.2'

annotationProcessor 'com.google.auto.value:auto-value:1.6.2'

Expand All @@ -100,32 +86,3 @@ dependencies {
testImplementation 'com.google.truth:truth:1.1'
testImplementation 'org.mockito:mockito-core:3.12.4'
}

signing {
sign publishing.publications.authLib
}

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

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

artifacts {
archives jar
archives javadocJar
archives sourcesJar
}

java {
withJavadocJar()
withSourcesJar()
}


compileJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'
7 changes: 5 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ signing.keyId=
signing.password=
signing.secretKeyRingFile=

sonatypeUsername=
sonatypePassword=
mavenCentralUsername=
mavenCentralPassword=

# Add a property to enable automatic release to Maven Central (optional, but good for CI)
# If true, publishToMavenCentral will also close and release the staging repository

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
9 changes: 0 additions & 9 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@ run {
systemProperties System.getProperties()
standardInput = System.in
}

sourceSets.all {
configurations.getByName(runtimeClasspathConfigurationName) {
attributes.attribute(Attribute.of("org.gradle.jvm.environment", String), "standard-jvm")
}
configurations.getByName(compileClasspathConfigurationName) {
attributes.attribute(Attribute.of("org.gradle.jvm.environment", String), "standard-jvm")
}
}
dependencies {
annotationProcessor 'com.google.auto.value:auto-value:1.6.2'

Expand Down
2 changes: 1 addition & 1 deletion sample/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists