-
Notifications
You must be signed in to change notification settings - Fork 2
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
0 parents
commit c5c5cf1
Showing
26 changed files
with
1,212 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Publish 1.6 | ||
|
||
on: | ||
push: | ||
branches: | ||
- "dev/1.6" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: "temurin" | ||
java-version: "17" | ||
- uses: gradle/wrapper-validation-action@v4 | ||
- run: cd test-mod && ./gradlew build | ||
- run: ./gradlew build publish --stacktrace | ||
env: | ||
MAVEN_URL: ${{ secrets.MAVEN_URL }} | ||
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} |
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,39 @@ | ||
.gradle | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
||
### Eclipse ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Mac OS ### | ||
.DS_Store |
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,122 @@ | ||
plugins { | ||
id("java") | ||
id("maven-publish") | ||
id("java-gradle-plugin") | ||
id("idea") | ||
} | ||
|
||
group = "babric" | ||
base.archivesName = project.name | ||
def baseVersion = "1.6" | ||
|
||
def ENV = System.getenv() | ||
|
||
if (ENV.containsKey("GITHUB_RUN_NUMBER")) { | ||
version = baseVersion + "." + ENV["GITHUB_RUN_NUMBER"] | ||
} else { | ||
version= "${baseVersion}.local" | ||
} | ||
|
||
repositories { | ||
maven { url = "https://maven.fabricmc.net/" } | ||
maven { | ||
name = 'Babric' | ||
url = 'https://maven.glass-launcher.net/babric' | ||
} | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation(gradleApi()) | ||
|
||
implementation("net.fabricmc:fabric-loom:${baseVersion}-SNAPSHOT") | ||
compileOnly("net.fabricmc:mapping-io:0.5.1") | ||
api("babric:stitch:0.6.2-babric.1") | ||
|
||
testImplementation(platform("org.junit:junit-bom:5.9.1")) | ||
testImplementation("org.junit.jupiter:junit-jupiter") | ||
} | ||
|
||
tasks.test { | ||
useJUnitPlatform() | ||
} | ||
|
||
jar { | ||
manifest { | ||
attributes 'Implementation-Version': project.version | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
it.options.encoding = "UTF-8" | ||
it.options.release = 17 | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
|
||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(17) | ||
} | ||
|
||
withSourcesJar() | ||
} | ||
|
||
gradlePlugin { | ||
plugins { | ||
babricLoom { | ||
id = 'babric-loom' | ||
implementationClass = 'babric.BabricLoomPlugin' | ||
} | ||
} | ||
} | ||
|
||
import org.w3c.dom.Document | ||
import org.w3c.dom.Element | ||
import org.w3c.dom.Node | ||
|
||
publishing { | ||
publications { | ||
// Also publish a snapshot so people can use the latest version if they wish | ||
snapshot(MavenPublication) { publication -> | ||
groupId project.group | ||
artifactId project.base.archivesName.get() | ||
version baseVersion + '-SNAPSHOT' | ||
|
||
from components.java | ||
} | ||
|
||
// Manually crate the plugin marker for snapshot versions | ||
snapshotPlugin(MavenPublication) { publication -> | ||
groupId 'babric-loom' | ||
artifactId 'babric-loom.gradle.plugin' | ||
version baseVersion + '-SNAPSHOT' | ||
|
||
pom.withXml({ | ||
// Based off org.gradle.plugin.devel.plugins.MavenPluginPublishPlugin | ||
Element root = asElement() | ||
Document document = root.getOwnerDocument() | ||
Node dependencies = root.appendChild(document.createElement('dependencies')) | ||
Node dependency = dependencies.appendChild(document.createElement('dependency')) | ||
Node groupId = dependency.appendChild(document.createElement('groupId')) | ||
groupId.setTextContent('babric') | ||
Node artifactId = dependency.appendChild(document.createElement('artifactId')) | ||
artifactId.setTextContent('babric-loom') | ||
Node version = dependency.appendChild(document.createElement('version')) | ||
version.setTextContent(baseVersion + '-SNAPSHOT') | ||
}) | ||
} | ||
} | ||
repositories { | ||
maven { | ||
if (ENV.MAVEN_URL) { | ||
url ENV.MAVEN_URL | ||
credentials { | ||
username ENV.MAVEN_USERNAME | ||
password ENV.MAVEN_PASSWORD | ||
} | ||
} | ||
} | ||
} | ||
} |
Binary file not shown.
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,6 @@ | ||
#Thu Mar 21 21:38:16 CET 2024 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.