Skip to content

Commit

Permalink
BATM-5470 Removed root build.gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
Filip Ocelka committed Oct 9, 2023
1 parent 66222b4 commit e3b602e
Show file tree
Hide file tree
Showing 14 changed files with 105 additions and 96 deletions.
1 change: 1 addition & 0 deletions annotations/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("shared-build-conventions")
id("shared-publish-conventions")
}

group = projectGroup
Expand Down
6 changes: 5 additions & 1 deletion batm_ssh_tunnel/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
plugins {
id("java")
id("application")
id("shared-build-conventions")
}

repositories {
mavenCentral()
}

version = "1.0.0"
Expand Down
65 changes: 0 additions & 65 deletions build.gradle

This file was deleted.

48 changes: 26 additions & 22 deletions buildSrc/src/main/groovy/shared-build-conventions.gradle
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
plugins {
id("java")
id("maven-publish")
id("com.generalbytes.gradle.main")
}

publishing {
if (hasGbUploadArtifactory()) {
repositories {
maven {
credentials {
username gbArtifactoryUser
password gbArtifactoryPassword
}
url gbArtifactoryUploadUrl
}
}
}
repositories {
mavenCentral()
}

publications {
mavenJava(MavenPublication) {
from components.java
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}

tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.incremental = true
}

dependencySubstitutions {
substitute file(batmDependencySubstitutionConfig)
substitute file("$project.rootDir/dependencySubstitutions.txt")
}

boolean hasGbUploadArtifactory() {
return project.hasProperty("gbArtifactoryUploadUrl")
&& project.hasProperty("gbArtifactoryUser")
&& project.hasProperty("gbArtifactoryPassword")
tasks.withType(AbstractArchiveTask).configureEach {
preserveFileTimestamps = false
reproducibleFileOrder = true
}

afterEvaluate {
if (pluginManager.hasPlugin('com.generalbytes.gradle.dependency.verification')) {
dependencyChecksums {
global = true
}
dependencyVerifications {
setConfigurations([]) // effectively turns off all checksum verifications - replaced by gradle's verification-metadata.xml
}
}
}
29 changes: 29 additions & 0 deletions buildSrc/src/main/groovy/shared-publish-conventions.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
plugins {
id("maven-publish")
}

publishing {
if (hasGbUploadArtifactory()) {
repositories {
maven {
credentials {
username gbArtifactoryUser
password gbArtifactoryPassword
}
url gbArtifactoryUploadUrl
}
}
}

publications {
mavenJava(MavenPublication) {
from components.java
}
}
}

private boolean hasGbUploadArtifactory() {
return project.hasProperty("gbArtifactoryUploadUrl")
&& project.hasProperty("gbArtifactoryUser")
&& project.hasProperty("gbArtifactoryPassword")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ext {
hasGbArtifactory = hasGbArtifactory()
}

repositories {
maven {
url = uri("https://jitpack.io")
}
if (hasGbArtifactory) {
maven {
url = uri(project.findProperty("gbArtifactoryUrl").toString())
credentials {
username = project.findProperty("gbArtifactoryUser").toString()
password = project.findProperty("gbArtifactoryPassword").toString()
}
}
}
}

private boolean hasGbArtifactory() {
return project.hasProperty('gbArtifactoryUrl')
&& project.hasProperty('gbArtifactoryUser')
&& project.hasProperty('gbArtifactoryPassword')
}
1 change: 1 addition & 0 deletions currencies/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("shared-build-conventions")
id("shared-publish-conventions")
}

group = projectGroup
Expand Down
2 changes: 1 addition & 1 deletion dependencySubstitutions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ substitute module: 'org.jetbrains.kotlin:kotlin-stdlib-jdk8', versions: ['1.3.31
substitute module: 'org.jetbrains.kotlin:kotlin-stdlib', versions: ['1.4.0'], toVersion: '1.4.10'
substitute module: 'org.jetbrains.kotlin:kotlin-stdlib-common', versions: ['1.4.0'], toVersion: '1.4.10'
substitute module: 'org.json:json', versions: ['20140107'], toVersion: '20180130'
substitute module: 'org.slf4j:slf4j-api', versions: ['1.7.20', '1.7.21', '1.7.25', '1.7.30', '1.7.32', '1.7.33', '1.8.0-beta4'], toVersion: '1.7.28'
substitute module: 'org.slf4j:slf4j-api', versions: ['1.7.20', '1.7.21', '1.7.25', '1.7.26', '1.7.30', '1.7.32', '1.7.33', '1.8.0-beta4'], toVersion: '1.7.28'
substitute module: 'org.knowm.xchange:xchange-core', versions: ['5.0.12', '5.0.13'], toVersion: '5.0.10'
substitute module: 'org.bouncycastle:bcprov-jdk15to18', versions: ['1.66'], toVersion: '1.69'
substitute module: 'com.fasterxml.jackson.datatype:jackson-datatype-guava', versions: ['2.11.2'], toVersion: '2.12.0'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# buildscript - project id
projectGroup=com.generalbytes.batm.public
projectVersion=1.1.16-snapshot
projectVersion=1.1.15

# buildscript - common dependency versions
bitrafaelVersion=1.0.44
Expand Down
11 changes: 11 additions & 0 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1616,6 +1616,17 @@
<artifact name="junit-bom-5.6.3.pom">
<sha256 value="ee7fe2e2a6e16792aed486a0d0a6bbc238e9b8a9b764722894e835cfe2f4cc20" origin="Generated by Gradle"/>
</artifact>
<artifact name="junit-bom-5.6.3.module">
<sha256 value="f37a30b1a76ae37058ebcaac66b9192a480455f4a8f2f285a35153d0578c8faa" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.junit" name="junit-bom" version="5.7.0">
<artifact name="junit-bom-5.7.0.pom">
<sha256 value="35fb15f8d0bee2b5900a22832762366552f9a349c56ced60ba123ce47738ff00" origin="Generated by Gradle"/>
</artifact>
<artifact name="junit-bom-5.7.0.module">
<sha256 value="25de454b3add67654d6691b53de7593b502967b5ff549547b104d7961f1a52bd" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.junit" name="junit-bom" version="5.7.1">
<artifact name="junit-bom-5.7.1.pom">
Expand Down
1 change: 1 addition & 0 deletions operators_sample_website/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("shared-build-conventions")
id("shared-publish-conventions")
}

group = projectGroup
Expand Down
1 change: 1 addition & 0 deletions server_extensions_api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("shared-build-conventions")
id("shared-publish-conventions")
id("distribution")
}

Expand Down
2 changes: 2 additions & 0 deletions server_extensions_extra/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
plugins {
id("shared-build-conventions")
id("shared-publish-conventions")
id("shared-repositories-ext-conventions")
}

group = projectGroup
Expand Down
8 changes: 2 additions & 6 deletions server_extensions_test/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id("java")
id("application")
id("com.generalbytes.gradle.main")
id("shared-build-conventions")
id("shared-repositories-ext-conventions")
}

application {
Expand All @@ -19,7 +19,3 @@ dependencies {
implementation("net.sf.jopt-simple:jopt-simple:4.9")
runtimeOnly("org.slf4j:slf4j-simple:1.7.28")
}

dependencySubstitutions {
substitute file(batmDependencySubstitutionConfig)
}

0 comments on commit e3b602e

Please sign in to comment.