-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Filip Ocelka
committed
Oct 9, 2023
1 parent
66222b4
commit 612d45e
Showing
14 changed files
with
110 additions
and
96 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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
plugins { | ||
id("shared-build-conventions") | ||
id("shared-publish-conventions") | ||
} | ||
|
||
group = projectGroup | ||
|
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 was deleted.
Oops, something went wrong.
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,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
29
buildSrc/src/main/groovy/shared-publish-conventions.gradle
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,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") | ||
} |
24 changes: 24 additions & 0 deletions
24
buildSrc/src/main/groovy/shared-repositories-ext-conventions.gradle
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,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') | ||
} |
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,5 +1,6 @@ | ||
plugins { | ||
id("shared-build-conventions") | ||
id("shared-publish-conventions") | ||
} | ||
|
||
group = projectGroup | ||
|
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
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,5 +1,6 @@ | ||
plugins { | ||
id("shared-build-conventions") | ||
id("shared-publish-conventions") | ||
} | ||
|
||
group = projectGroup | ||
|
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,5 +1,6 @@ | ||
plugins { | ||
id("shared-build-conventions") | ||
id("shared-publish-conventions") | ||
id("distribution") | ||
} | ||
|
||
|
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