|
@@ -81,6 +81,54 @@ allprojects {
|
81
|
81
|
}
|
82
|
82
|
}
|
83
|
83
|
|
|
84
|
+task createVersionConfig << {
|
|
85
|
+ def gitDir = new File(projectDir, '.git')
|
|
86
|
+
|
|
87
|
+ def jgit = new org.mdonoughe.JGitDescribeTask()
|
|
88
|
+ jgit.dir = gitDir
|
|
89
|
+
|
|
90
|
+ version = jgit.getDescription()
|
|
91
|
+ def targetFile = new File(buildDir, 'version.config')
|
|
92
|
+
|
|
93
|
+ targetFile << "keysections:\n identity\n version\n updater\n\n"
|
|
94
|
+ targetFile << "identity:\n name=DMDirc version information\n globaldefault=true\n order=95000\n\n"
|
|
95
|
+ targetFile << "version:\n version=${version}\n\n"
|
|
96
|
+ targetFile << "buildenv:\n"
|
|
97
|
+ def compileConfiguration = project.configurations.getByName("compile")
|
|
98
|
+ def resolvedConfiguration = compileConfiguration.resolvedConfiguration
|
|
99
|
+ def resolvedArtifacts = resolvedConfiguration.resolvedArtifacts
|
|
100
|
+ resolvedArtifacts.each { dp ->
|
|
101
|
+ def version = dp.moduleVersion.id
|
|
102
|
+ targetFile << " " + version.group + " " + version.name + " " + version.version + "\n"
|
|
103
|
+ }
|
|
104
|
+}
|
|
105
|
+
|
|
106
|
+jar.dependsOn createVersionConfig
|
|
107
|
+
|
|
108
|
+jar {
|
|
109
|
+ from("$buildDir/version.config") {
|
|
110
|
+ into 'com/dmdirc/'
|
|
111
|
+ }
|
|
112
|
+
|
|
113
|
+ from { configurations.bundle.collect { it.isDirectory() ? it : zipTree(it) } } {
|
|
114
|
+ exclude 'META-INF/**'
|
|
115
|
+ }
|
|
116
|
+}
|
|
117
|
+
|
|
118
|
+buildscript {
|
|
119
|
+ repositories {
|
|
120
|
+ mavenCentral()
|
|
121
|
+ maven {
|
|
122
|
+ url 'http://nexus.dmdirc.com/nexus/content/repositories/thirdparty/'
|
|
123
|
+ }
|
|
124
|
+ }
|
|
125
|
+
|
|
126
|
+ dependencies {
|
|
127
|
+ classpath group: 'com.github.shanemcc', name: 'jgit-describe', version: '0.5'
|
|
128
|
+ classpath group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '2.3.1.+'
|
|
129
|
+ }
|
|
130
|
+}
|
|
131
|
+
|
84
|
132
|
task wrapper(type: Wrapper) {
|
85
|
133
|
gradleVersion = '2.1'
|
86
|
134
|
}
|