-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
141 lines (114 loc) · 3.59 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
buildscript {
repositories {
maven {
url "https://repo1.maven.org/maven2"
}
maven {
name = "forge"
url = "https://maven.minecraftforge.net/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath ('com.anatawa12.forge:ForgeGradle:1.2-1.1.+') {
changing = true
}
}
}
apply plugin: 'forge'
apply plugin: 'idea'
sourceCompatibility = targetCompatibility = "1.7"
compileJava { sourceCompatibility = targetCompatibility = "1.7" }
ext.configFile = file "build.properties"
configFile.withReader {
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
configurations {
embedded
implementation.extendsFrom embedded
}
def commonManifest = {
attributes FMLCorePlugin: "li.cil.oc.common.launch.TransformerLoader"
attributes FMLCorePluginContainsFMLMod: "true"
attributes FMLAT: "oc_at.cfg"
}
version = config.modVersion.toString()
group= "src.train" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "TC-Community-Pack"
minecraft {
version = "1.7.10-10.13.4.1614-1.7.10"
runDir = "run"
replaceIn "TCCEAddonInfo.java"
replace "@VERSION1@", config.modVersion.toString()
}
//task packApi(type: Jar, dependsOn: "classes") {
// // Jar will always be updated
// outputs.upToDateWhen {false}
// Set the jar's base name
// baseName = "Traincraft"
//from (sourceSets.main.output) {
// excludes.addAll('**/*.info')
//excludes.addAll('assets/tc/textures/trains')
//excludes.addAll('assets/tc/sounds')
// }
//}
task buildSubmoduleJar(type: GradleBuild) {
description = 'Builds the JAR from the submodule'
dir = 'submodules/Traincraft' // Adjust this path to match your submodule location
tasks = ['clean', 'packapi']
}
task copySubmoduleJar(type: Copy, dependsOn: buildSubmoduleJar) {
description = 'Copies the JAR from the submodule to the main repository'
from 'submodules/Traincraft/build/libs' // The directory where the submodule's JAR is located
into 'lib' // The destination directory in the main repository
include '*.jar'
}
task getTrainAPI(dependsOn: copySubmoduleJar) {
description = 'Builds the JAR from the submodule and copies it to the main repository'
group = 'build'
}
repositories {
maven {
name "gt"
url "https://gregtech.overminddl1.com/"
}
maven {
name "codechicken"
url "https://maven.cil.li/"
}
flatDir {
dirs "lib"
}
maven {
name "curse.maven"
url "https://cursemaven.com"
}
ivy {
name "BuildCraft"
artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision]-[classifier].[ext]"
}
}
dependencies {
// `compile` will compile it and run with `runClient`/`runServer`
// `compileOnly will only compile but not load in dev testing (can still put in the instance mods directory though)
compileOnly "li.cil.oc:OpenComputers:MC1.7.10-1.7.2.1204:dev"
compileOnly "com.mod-buildcraft:buildcraft:7.1.23:dev"
compile "codechicken:CodeChickenLib:1.7.10-1.1.3.136:dev"
compile "codechicken:CodeChickenCore:1.7.10-1.0.4.35:dev"
compile "codechicken:NotEnoughItems:1.7.10-1.0.4.90:dev"
implementation "train:Traincraft-4.5.0_001"
// quality of life line to simplify importing jars for experimental testing
compile fileTree(dir: 'lib', include: ['*.jar'])
}
idea
{
module
{
inheritOutputDirs = true
}
}