-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build: use buildsrc * build: remove useless define * build: update
- Loading branch information
CoolLoong
authored
Jun 11, 2024
1 parent
202efb4
commit 6e08b4f
Showing
14 changed files
with
139 additions
and
168 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 |
---|---|---|
|
@@ -31,4 +31,5 @@ | |
/Allay-Server/ban-info.yml | ||
/Allay-Server/whitelist.yml | ||
/.jacoco/ | ||
/.vscode/ | ||
/.vscode/ | ||
/buildSrc/.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
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 { | ||
`java-library` | ||
id("buildlogic.common") | ||
} | ||
|
||
group = "org.allaymc" | ||
|
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,3 +1,7 @@ | ||
plugins { | ||
id("buildlogic.common") | ||
} | ||
|
||
group = "org.allaymc" | ||
description = "codegen" | ||
version = "1.0.0" | ||
|
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,3 +1,7 @@ | ||
plugins { | ||
id("buildlogic.common") | ||
} | ||
|
||
group = "org.allaymc" | ||
description = "data" | ||
version = "1.0.0" | ||
|
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 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* This file was generated by the Gradle 'init' task. | ||
*/ | ||
|
||
plugins { | ||
// Support convention plugins written in Kotlin. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build. | ||
java | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
// Use the plugin portal to apply community plugins in convention plugins. | ||
gradlePluginPortal() | ||
} | ||
|
||
dependencies { | ||
implementation("com.github.johnrengelman:shadow:8.1.1") | ||
} |
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 @@ | ||
rootProject.name = "buildSrc" |
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,103 @@ | ||
import java.nio.charset.StandardCharsets | ||
|
||
plugins { | ||
// Apply the java Plugin to add support for Java. | ||
java | ||
idea | ||
`maven-publish` | ||
id("com.github.johnrengelman.shadow") | ||
} | ||
|
||
java { | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
repositories { | ||
// Use Maven Central for resolving dependencies. | ||
mavenLocal() | ||
mavenCentral() | ||
maven("https://www.jitpack.io/") | ||
maven("https://repo.opencollab.dev/maven-releases/") | ||
maven("https://repo.opencollab.dev/maven-snapshots/") | ||
maven("https://storehouse.okaeri.eu/repository/maven-public/") | ||
} | ||
|
||
dependencies { | ||
//libs.versions.toml cannot be used in public plugin scripts | ||
compileOnly("org.projectlombok:lombok:1.18.32") | ||
|
||
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2") | ||
testImplementation("org.mockito:mockito-junit-jupiter:5.12.0") | ||
|
||
testCompileOnly("org.projectlombok:lombok:1.18.32") | ||
|
||
annotationProcessor("org.projectlombok:lombok:1.18.32") | ||
testAnnotationProcessor("org.projectlombok:lombok:1.18.32") | ||
} | ||
|
||
// Apply a specific Java toolchain to ease working on different environments. | ||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(21) | ||
} | ||
} | ||
|
||
tasks.build { | ||
//control the task group is "alpha build" | ||
group = "alpha build" | ||
dependsOn("shadowJar") | ||
} | ||
|
||
tasks.register<DefaultTask>("fastBuild") { | ||
dependsOn(tasks.build) | ||
group = "alpha build" | ||
tasks["javadoc"].enabled = false | ||
tasks["javadocJar"].enabled = false | ||
tasks["sourcesJar"].enabled = false | ||
tasks["compileTestJava"].enabled = false | ||
tasks["processTestResources"].enabled = false | ||
tasks["testClasses"].enabled = false | ||
tasks["test"].enabled = false | ||
tasks["check"].enabled = false | ||
} | ||
|
||
tasks.register<DefaultTask>("buildForGithubAction") { | ||
dependsOn(tasks.build) | ||
group = "alpha build" | ||
tasks["javadoc"].enabled = false | ||
tasks["javadocJar"].enabled = false | ||
} | ||
|
||
tasks.clean { | ||
group = "alpha build" | ||
} | ||
|
||
// disable assemble | ||
tasks.assemble { | ||
enabled = false | ||
} | ||
|
||
tasks.test { | ||
useJUnitPlatform() | ||
workingDir = File("${rootProject.projectDir}/.run/") | ||
} | ||
|
||
tasks.withType<JavaCompile> { | ||
options.encoding = StandardCharsets.UTF_8.name() | ||
} | ||
|
||
tasks.withType<Copy> { | ||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE | ||
} | ||
|
||
tasks.withType<Javadoc> { | ||
options.encoding = StandardCharsets.UTF_8.name() | ||
val javadocOptions = options as CoreJavadocOptions | ||
javadocOptions.addStringOption( | ||
"source", | ||
java.sourceCompatibility.toString() | ||
) | ||
// Suppress some meaningless warnings | ||
javadocOptions.addStringOption("Xdoclint:none", "-quiet") | ||
} |
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