Skip to content

Commit caaf440

Browse files
committed
update buildscripts and gradle and bump version
1 parent edc906b commit caaf440

8 files changed

Lines changed: 267 additions & 323 deletions

File tree

.gitignore

Lines changed: 24 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,33 @@
1-
# User-specific stuff
2-
.idea/
1+
# gradle
2+
.gradle/
3+
build/
4+
out/
5+
classes/
6+
7+
# eclipse
8+
*.launch
39

10+
# idea
11+
.idea/
412
*.iml
513
*.ipr
614
*.iws
715

8-
# IntelliJ
9-
out/
10-
# mpeltonen/sbt-idea plugin
11-
.idea_modules/
12-
13-
# JIRA plugin
14-
atlassian-ide-plugin.xml
15-
16-
# Compiled class file
17-
*.class
18-
19-
# Log file
20-
*.log
21-
22-
# BlueJ files
23-
*.ctxt
24-
25-
# Package Files #
26-
*.jar
27-
*.war
28-
*.nar
29-
*.ear
30-
*.zip
31-
*.tar.gz
32-
*.rar
33-
34-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
35-
hs_err_pid*
36-
37-
*~
38-
39-
# temporary files which can be created if a process still has a handle open of a deleted file
40-
.fuse_hidden*
41-
42-
# KDE directory preferences
43-
.directory
44-
45-
# Linux trash folder which might appear on any partition or disk
46-
.Trash-*
47-
48-
# .nfs files are created when an open file is removed but is still being accessed
49-
.nfs*
50-
51-
# General
52-
.DS_Store
53-
.AppleDouble
54-
.LSOverride
55-
56-
# Icon must end with two \r
57-
Icon
58-
59-
# Thumbnails
60-
._*
61-
62-
# Files that might appear in the root of a volume
63-
.DocumentRevisions-V100
64-
.fseventsd
65-
.Spotlight-V100
66-
.TemporaryItems
67-
.Trashes
68-
.VolumeIcon.icns
69-
.com.apple.timemachine.donotpresent
70-
71-
# Directories potentially created on remote AFP share
72-
.AppleDB
73-
.AppleDesktop
74-
Network Trash Folder
75-
Temporary Items
76-
.apdisk
77-
78-
# Windows thumbnail cache files
79-
Thumbs.db
80-
Thumbs.db:encryptable
81-
ehthumbs.db
82-
ehthumbs_vista.db
83-
84-
# Dump file
85-
*.stackdump
86-
87-
# Folder config file
88-
[Dd]esktop.ini
89-
90-
# Recycle Bin used on file shares
91-
$RECYCLE.BIN/
92-
93-
# Windows Installer files
94-
*.cab
95-
*.msi
96-
*.msix
97-
*.msm
98-
*.msp
99-
100-
# Windows shortcuts
101-
*.lnk
102-
103-
.gradle
104-
build/
105-
106-
# Ignore Gradle GUI config
107-
gradle-app.setting
108-
109-
# Cache of project
110-
.gradletasknamecache
16+
# vscode
17+
.settings/
18+
.vscode/
19+
bin/
20+
.classpath
21+
.project
11122

112-
**/build/
23+
# macos
24+
*.DS_Store
11325

114-
# Common working directory
26+
# fabric
11527
run/
11628

117-
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
118-
!gradle-wrapper.jar
29+
# java
30+
hs_err_*.log
31+
replay_*.log
32+
*.hprof
33+
*.jfr

build.gradle

Lines changed: 35 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,60 @@
11
plugins {
2-
id 'fabric-loom' version '0.8-SNAPSHOT'
3-
id 'maven-publish'
2+
alias libs.plugins.fabric.loom
3+
id "maven-publish"
44
}
55

6-
/*
7-
* Gets the version name from the latest Git tag
8-
*/
9-
// https://stackoverflow.com/questions/28498688/gradle-script-to-autoversion-and-include-the-commit-hash-in-android
10-
def getGitCommit = { ->
11-
def stdout = new ByteArrayOutputStream()
12-
exec {
13-
commandLine 'git', 'rev-parse', '--short', 'HEAD'
14-
standardOutput = stdout
15-
}
16-
return stdout.toString().trim()
6+
version = "$mod_version+$target_version"
7+
group = maven_group
8+
9+
base {
10+
archivesName = archives_name
1711
}
1812

19-
sourceCompatibility = JavaVersion.VERSION_16
20-
targetCompatibility = JavaVersion.VERSION_16
13+
repositories {
14+
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots" }
15+
}
2116

22-
archivesBaseName = project.archives_base_name
23-
version = project.mod_version + "+fabric." + getGitCommit()
24-
group = project.maven_group
17+
loom {
18+
decompilers {
19+
vineflower {
20+
options.putAll(["mark-corresponding-synthetics": "1", "ind": " "])
21+
}
22+
}
23+
mixin {
24+
useLegacyMixinAp = false
25+
}
26+
accessWidenerPath = file("src/main/resources/starlight.accesswidener")
27+
}
2528

2629
dependencies {
27-
//to change the versions see the gradle.properties file
28-
minecraft "com.mojang:minecraft:${project.minecraft_version}"
29-
//mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
30-
mappings minecraft.officialMojangMappings()
31-
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
32-
33-
// Fabric API. This is technically optional, but you probably want it anyway.
34-
//modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
35-
36-
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
37-
// You may need to force-disable transitiveness on them.
30+
minecraft libs.minecraft
31+
mappings loom.officialMojangMappings()
32+
modImplementation libs.fabric.loader
33+
vineflowerDecompilerClasspath libs.vineflower
3834
}
3935

4036
processResources {
41-
inputs.property "version", project.version
42-
43-
filesMatching("fabric.mod.json") {
44-
expand "version": project.version
37+
filesMatching "fabric.mod.json", {
38+
expand "version": version
4539
}
4640
}
4741

48-
// ensure that the encoding is set to UTF-8, no matter what the system default is
49-
// this fixes some edge cases with special characters not displaying correctly
50-
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
51-
tasks.withType(JavaCompile) {
52-
options.encoding = "UTF-8"
53-
}
54-
55-
minecraft {
56-
accessWidener "src/main/resources/starlight.accesswidener"
42+
tasks.withType(JavaCompile).configureEach {
43+
it.options.encoding = "UTF-8"
44+
if (JavaVersion.current().isJava9Compatible()) it.options.release.set(8)
5745
}
5846

59-
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
60-
// if it is present.
61-
// If you remove this task, sources will not be generated.
6247
java {
63-
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
64-
// if it is present.
65-
// If you remove this line, sources will not be generated.
66-
withSourcesJar()
48+
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
6749
}
50+
6851
jar {
6952
from "LICENSE"
7053
}
7154

72-
// configure the maven publication
7355
publishing {
74-
publications {
75-
mavenJava(MavenPublication) {
76-
// add all the jars that should be included when publishing to maven
77-
artifact(remapJar) {
78-
builtBy remapJar
79-
}
80-
artifact(sourcesJar) {
81-
builtBy remapSourcesJar
82-
}
83-
}
84-
}
85-
86-
// select the repositories you want to publish to
87-
repositories {
88-
// uncomment to publish to the local maven
89-
// mavenLocal()
56+
publications.create("mavenJava", MavenPublication) {
57+
from components.java
9058
}
59+
repositories {}
9160
}

gradle.properties

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1-
# Done to increase the memory available to gradle.
2-
org.gradle.jvmargs=-Xmx1G
3-
org.gradle.daemon=false
4-
# Fabric Properties
5-
# check these on https://modmuss50.me/fabric.html
6-
minecraft_version=1.17.1
7-
yarn_mappings=1.17.1+build.1
8-
loader_version=0.11.6
9-
# Mod Properties
10-
mod_version=1.0.0
11-
maven_group=ca.spottedleaf.starlight
12-
archives_base_name=starlight
13-
# Dependencies
14-
# check this on https://modmuss50.me/fabric.html
15-
#fabric_version=0.24.3+build.414-1.16
1+
org.gradle.jvmargs = -Xmx2G
2+
org.gradle.parallel = true
3+
org.gradle.caching = true
4+
5+
mod_version = 1.0.1
6+
target_version = 1.17.1
7+
archives_name = starlight
8+
maven_group = ca.spottedleaf.starlight

gradle/libs.versions.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[versions]
2+
minecraft = "1.17.1"
3+
fabric_loader = "0.15.6"
4+
loom = "1.5-SNAPSHOT"
5+
vineflower = "1.10.0-SNAPSHOT"
6+
7+
[libraries]
8+
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
9+
fabric_loader = { module = "net.fabricmc:fabric-loader", version.ref = "fabric_loader" }
10+
vineflower = { module = "org.vineflower:vineflower", version.ref = "vineflower" }
11+
12+
[plugins]
13+
fabric_loom = { id = "fabric-loom", version.ref = "loom" }

gradle/wrapper/gradle-wrapper.jar

-15.1 KB
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)