Skip to content

Commit

Permalink
Merge pull request #6 from GTNewHorizons/update-build-script
Browse files Browse the repository at this point in the history
Update build script and CI
  • Loading branch information
boubou19 authored Nov 30, 2021
2 parents d07fd56 + ce4a94f commit aef0908
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 63 deletions.
44 changes: 0 additions & 44 deletions .github/workflows/release-latest.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@ whitelist.json
*.ipr
*.iws
src/main/resources/mixins.*.json
*.bat
29 changes: 11 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: a553e159ecaf0fc236cf25b2c124ea90f92bb140
//version: ffe7b130f98fdfa1ac7c6ba4bd34722a55ab28d4
/*
DO NOT CHANGE THIS FILE!
Expand Down Expand Up @@ -62,6 +62,10 @@ idea {
}
}

if(JavaVersion.current() != JavaVersion.VERSION_1_8) {
throw new GradleException("This project requires Java 8, but it's running on " + JavaVersion.current())
}

checkPropertyExists("modName")
checkPropertyExists("modId")
checkPropertyExists("modGroup")
Expand Down Expand Up @@ -153,7 +157,12 @@ configurations.all {
// Fix Jenkins' Git: chmod a file should not be detected as a change and append a '.dirty' to the version
'git config core.fileMode false'.execute()
// Pulls version from git tag
version = minecraftVersion + "-" + gitVersion()
try {
version = minecraftVersion + "-" + gitVersion()
}
catch (Exception e) {
throw new IllegalStateException("This mod must be version controlled by Git AND the repository must provide at least one tag!");
}
group = modGroup
archivesBaseName = modId

Expand Down Expand Up @@ -451,22 +460,6 @@ artifacts {
}
}

// Crude handler to append custom maven repositories to maven dependency
install{
repositories{
mavenInstaller{
pom.withXml {
def repositoriesNode = asNode().appendNode("repositories")
project.repositories.each { repository ->
def repositoryNode = repositoriesNode.appendNode("repository")
repositoryNode.appendNode("name", repository.name)
repositoryNode.appendNode("url", repository.properties.get("url"))
}
}
}
}
}

// Updating
task updateBuildScript {
doLast {
Expand Down

0 comments on commit aef0908

Please sign in to comment.