-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
84 lines (72 loc) · 2.28 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
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
def versionMajor = "1"
def versionMinor = "0"
version = versionMajor + "." + versionMinor + getBuildNumber()
group= "com.mcgoodtime.onelauncher"
archivesBaseName = "OneLauncher"
compileJava.options.encoding = 'UTF-8'
repositories {
mavenCentral()
maven {
url = 'https://dl.bintray.com/goodtimestudio/maven/'
}
}
configurations {
shade
compile.extendsFrom shade
}
dependencies {
shade 'com.mcgoodtime.gjmlc:gjmlc:1.0.11'
shade 'com.google.code.gson:gson:2.5'
shade 'org.apache.commons:commons-lang3:3.4'
shade 'com.googlecode.soundlibs:jlayer:1.0.1-1'
}
jar {
configurations.shade.copyRecursive().setTransitive(false).each { artifact ->
from (zipTree(artifact))
}
manifest {
attributes 'Implementation-Title': 'OneLauncher',
'Implementation-Version': version
}
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/main/resources'
}
}
}
idea.workspace.iws.withXml { provider ->
def xml = """
<configuration default="false" name="OneLauncher" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" runner="idea" />
<option name="MAIN_CLASS_NAME" value="com.mcgoodtime.onelauncher.core.OneLauncher" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://\$PROJECT_DIR\$/run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="OneLauncher" />
<envs />
<method />
</configuration>
"""
def runConfig = new XmlParser().parseText(xml)
provider.asNode().component.each {
if (it.attribute("name").equals("RunManager")) {
it.append(runConfig)
}
}
}
def getBuildNumber() {
return "$System.env.BUILD_NUMBER" != "null" ? "." + Integer.parseInt("$System.env.BUILD_NUMBER") : ""
}