mirror of
https://github.com/GTNewHorizons/Forgelin.git
synced 2026-11-19 11:59:15 +00:00
Add automatic version replacement in Forgelin.kt (#20)
* Add automatic version replacement in Forgelin.kt * Remove unnecessary newlines caused by IDEA
This commit is contained in:
1 parent
8a5751bc19
commit
23dfb368e1
2 files changed
+21
-3
No files matched your search
+20
-2
@@ -31,8 +31,7 @@ minecraft {
|
||||
|
||||
mappings = mcp_mappings
|
||||
|
||||
replaceIn "Reference.kt"
|
||||
replaceIn "Reference.kt"
|
||||
replaceIn "Forgelin.kt"
|
||||
replace "@VERSION@", mod_version
|
||||
|
||||
useDepAts = true
|
||||
@@ -90,6 +89,25 @@ shadowJar {
|
||||
|
||||
tasks.build.dependsOn shadowJar
|
||||
|
||||
import net.minecraftforge.gradle.user.TaskSourceCopy
|
||||
|
||||
// Enables source replacements for Kotlin code
|
||||
for (set in sourceSets) {
|
||||
def taskName = "source${set.name.capitalize()}Kotlin"
|
||||
def dir = new File(project.getBuildDir(), "sources/${set.name}/kotlin")
|
||||
task(taskName, type: TaskSourceCopy) {
|
||||
source = set.getKotlin()
|
||||
output = dir
|
||||
}
|
||||
def compileTask = tasks[set.getCompileTaskName("kotlin")]
|
||||
compileTask.source = dir
|
||||
compileTask.dependsOn taskName
|
||||
def dirPath = dir.toPath()
|
||||
compileKotlin.include {
|
||||
return it.file.toPath().startsWith(dirPath)
|
||||
}
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives shadowJar
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@ object Forgelin {
|
||||
|
||||
const val MOD_ID = "forgelin"
|
||||
const val NAME = "Forgelin"
|
||||
const val VERSION = "1.4.2"
|
||||
const val VERSION = "@VERSION@"
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user