Skip to content

Commit

Permalink
update gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
h908714124 committed Mar 28, 2024
1 parent 48ecf04 commit d591eb0
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 171 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ jobs:
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 20
java-version: 21
- run: ./gradlew simple-component:javadoc compiler:javadoc compiler:test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ build
.gradle
/gradlew.bat
/compiler/out
/.DS_Store
191 changes: 93 additions & 98 deletions compiler/build.gradle
Original file line number Diff line number Diff line change
@@ -1,149 +1,144 @@
plugins {
id('java')
id('maven-publish')
id('com.github.johnrengelman.shadow') version('8.1.1')
id('signing')
id('java')
id('maven-publish')
id('com.github.johnrengelman.shadow') version('8.1.1')
id('signing')
}

group = 'io.github.jbock-java'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

compileJava {
options.encoding = 'UTF-8'
sourceCompatibility = '11'
targetCompatibility = '11'
options.compilerArgs << '--release'
options.compilerArgs << '11'
options.encoding = 'UTF-8'
sourceCompatibility = '11'
targetCompatibility = '11'
options.compilerArgs << '--release'
options.compilerArgs << '11'
}

javadoc {
options.encoding = 'UTF-8'
options.encoding = 'UTF-8'
}

repositories {
mavenCentral()
mavenCentral()
}

shadowJar {
minimize()
archiveClassifier.set('')
minimize()
archiveClassifier.set('')
}

tasks.withType(AbstractArchiveTask) {
preserveFileTimestamps = false
reproducibleFileOrder = true
preserveFileTimestamps = false
reproducibleFileOrder = true
}

tasks.withType(GenerateModuleMetadata) {
enabled = true
enabled = true
}

shadowJar {
minimize()
archiveClassifier.set('')
relocate('io.jbock.auto.common', 'io.jbock.simple.auto.common')
relocate('io.jbock.javapoet', 'io.jbock.simple.javapoet')
minimize()
archiveClassifier.set('')
relocate('io.jbock.auto.common', 'io.jbock.simple.auto.common')
relocate('io.jbock.javapoet', 'io.jbock.simple.javapoet')
}

dependencies {
def simple_component = project(':simple-component')
implementation('io.github.jbock-java:javapoet:1.15')
implementation('io.github.jbock-java:auto-common:1.2.3')
shadow(simple_component)
annotationProcessor('io.github.jbock-java:simple-component-compiler:1.024')
testImplementation('io.github.jbock-java:compile-testing:0.19.12')
testImplementation('org.junit.jupiter:junit-jupiter:5.10.1')
testImplementation(simple_component)
testImplementation('jakarta.inject:jakarta.inject-api:2.0.1')
testImplementation('javax.inject:javax.inject:1')
def simple_component = project(':simple-component')
implementation('io.github.jbock-java:javapoet:1.15')
implementation('io.github.jbock-java:auto-common:1.2.3')
shadow(simple_component)
annotationProcessor('io.github.jbock-java:simple-component-compiler:1.024')
testImplementation('io.github.jbock-java:compile-testing:0.19.12')
testImplementation('org.junit.jupiter:junit-jupiter:5.10.1')
testImplementation(simple_component)
testImplementation('jakarta.inject:jakarta.inject-api:2.0.1')
testImplementation('javax.inject:javax.inject:1')
testRuntimeOnly('org.junit.platform:junit-platform-launcher')
}

jar {
manifest {
attributes(
'Implementation-Version': project.properties['version']
)
}
manifest {
attributes(
'Implementation-Version': project.properties['version']
)
}
}

test {
useJUnitPlatform()
testLogging {
events('failed')
}
useJUnitPlatform()
testLogging {
events('failed')
}
}

task javadocJar(type: Jar) {
from javadoc
archiveClassifier.set('javadoc')
from javadoc
archiveClassifier.set('javadoc')
}

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

artifacts {
archives(javadocJar, sourcesJar)
archives(javadocJar, sourcesJar)
}

// https://central.sonatype.org/pages/gradle.html
publishing {
publications {
shadow(MavenPublication) { publication ->
project.shadow.component(publication)
artifactId = 'simple-component-compiler'

artifact sourcesJar
artifact javadocJar

pom {
name = 'simple-component-compiler'
packaging = 'jar'
description = 'simple-component'
url = 'https://github.com/jbock-java/simple-component'

licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'Various'
name = 'Various'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:https://github.com/jbock-java/simple-component.git'
developerConnection = 'scm:git:https://github.com/jbock-java/simple-component.git'
url = 'https://github.com/jbock-java/simple-component'
}
}
}
}
repositories {
maven {
url = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials {
username = System.getenv('OSS_USER')
password = System.getenv('OSS_PASS')
}
}
}
publications {
shadow(MavenPublication) { publication ->
project.shadow.component(publication)
artifactId = 'simple-component-compiler'

artifact sourcesJar
artifact javadocJar

pom {
name = 'simple-component-compiler'
packaging = 'jar'
description = 'simple-component'
url = 'https://github.com/jbock-java/simple-component'

licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'Various'
name = 'Various'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:https://github.com/jbock-java/simple-component.git'
developerConnection = 'scm:git:https://github.com/jbock-java/simple-component.git'
url = 'https://github.com/jbock-java/simple-component'
}
}
}
}
repositories {
maven {
url = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials {
username = System.getenv('OSS_USER')
password = System.getenv('OSS_PASS')
}
}
}
}

// https://docs.gradle.org/current/userguide/signing_plugin.html
signing {
def signingKey = findProperty('signingKey')
def signingPassword = findProperty('signingPassword')
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.shadow
def signingKey = findProperty('signingKey')
def signingPassword = findProperty('signingPassword')
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.shadow
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading

0 comments on commit d591eb0

Please sign in to comment.