-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
6 changed files
with
119 additions
and
68 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,18 +1,24 @@ | ||
# Ignore Gradle project-specific cache directory | ||
.gradle | ||
gradle.properties | ||
|
||
# Ignore Gradle build output directory | ||
build | ||
buildRT | ||
|
||
# eclipse | ||
bin | ||
*.launch | ||
.settings | ||
.project | ||
.metadata | ||
.classpath | ||
.project | ||
|
||
.iws | ||
workspace.xml | ||
tasks.xml | ||
# idea | ||
out | ||
*.ipr | ||
*.iws | ||
*.iml | ||
.idea | ||
|
||
# gradle | ||
build | ||
.gradle | ||
libs | ||
private.properties | ||
repo | ||
|
||
# other | ||
eclipse |
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,21 +1,107 @@ | ||
import org.ajoberstar.grgit.Tag | ||
|
||
plugins { | ||
id 'java' | ||
id 'maven-publish' | ||
id 'org.ajoberstar.grgit' version '4.1.0' | ||
} | ||
|
||
def privateProps = new Properties() | ||
def privatePropsFile = file("private.properties") | ||
if(privatePropsFile.exists()) | ||
privatePropsFile.withInputStream { privateProps.load(it) } | ||
|
||
ext { | ||
getHeadId = { | ||
return grgit.head().abbreviatedId | ||
} | ||
getHeadTag = { | ||
def headId = grgit.head().id | ||
def headTag = null | ||
|
||
grgit.tag.list().forEach { | ||
def tag = it as Tag | ||
if(tag.commit.id == headId) headTag = tag | ||
} | ||
|
||
return headTag | ||
} | ||
PRIVATE = privateProps | ||
} | ||
|
||
def getVersion(boolean strict = false) { | ||
def headTag = rootProject.ext.getHeadTag() | ||
def tagName = null | ||
if (headTag != null && (tagName = headTag.name).matches('^v[0-9]+\\.[0-9]+\\.[0-9]+$')) { | ||
return (tagName as String).substring(1) | ||
} else { | ||
if(strict) { | ||
if (headTag == null) throw new IllegalStateException("Commit HEAD is not tagged.") | ||
else throw new IllegalStateException("Commit HEAD tag '${tagName}' does not meet the required versioning scheme.") | ||
} else return "dev-${rootProject.ext.getHeadId()}" as String | ||
} | ||
} | ||
|
||
group 'work.lclpnet' | ||
archivesBaseName = 'launcher-logic-forge-installer' | ||
version getVersion() | ||
|
||
sourceCompatibility = targetCompatibility = '16' | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { | ||
url "http://files.minecraftforge.net/maven" | ||
url "https://maven.minecraftforge.net" | ||
} | ||
} | ||
|
||
dependencies { | ||
testCompile group: 'junit', name: 'junit', version: '4.12' | ||
compileOnly "net.minecraftforge:forge:1.15.2-31.2.36:installer" | ||
implementation 'net.minecraftforge:forge:1.16.5-36.1.4:installer' | ||
|
||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0' | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0' | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
jar { | ||
manifest { | ||
attributes 'Main-Class': 'work.lclpnet.forgeinstaller.ForgeInstaller' | ||
manifest.attributes( | ||
'Main-Class': 'work.lclpnet.forgeinstaller.ForgeInstaller' | ||
) | ||
} | ||
|
||
tasks.publish.dependsOn({ | ||
def versionTest = getVersion(true) | ||
println("Publishing version '${versionTest}'...") | ||
}) | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
artifactId = archivesBaseName | ||
from components.java | ||
|
||
pom { | ||
name = 'LauncherLogic Forge Installer' | ||
description = 'Installer for MinecraftForge for LauncherLogic' | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
if (privateProps.containsKey('mavenPassword') | ||
&& privateProps.containsKey('mavenHost') | ||
&& privateProps.containsKey('mavenUser')) { | ||
credentials { | ||
username privateProps.getProperty('mavenUser') | ||
password privateProps.getProperty('mavenPassword') | ||
} | ||
url privateProps.getProperty('mavenHost') | ||
} else { | ||
url "file:///${project.projectDir}/repo" | ||
} | ||
} | ||
} | ||
} |
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,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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
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