|
@@ -1,5 +1,10 @@
|
1
|
1
|
// DMDirc plugins build script
|
2
|
2
|
subprojects {
|
|
3
|
+ def jgit = new org.mdonoughe.JGitDescribeTask()
|
|
4
|
+ jgit.dir = new File(projectDir.parent, '.git')
|
|
5
|
+ jgit.subDir = projectDir
|
|
6
|
+ project.version = jgit.getDescription() + '-SNAPSHOT'
|
|
7
|
+
|
3
|
8
|
apply plugin: 'java'
|
4
|
9
|
apply plugin: 'findbugs'
|
5
|
10
|
apply plugin: 'pmd'
|
|
@@ -63,15 +68,8 @@ subprojects {
|
63
|
68
|
}
|
64
|
69
|
|
65
|
70
|
task updatePluginConfig(dependsOn: copyPluginConfig) << {
|
66
|
|
- def gitDir = new File(projectDir.parent, '.git')
|
67
|
|
-
|
68
|
|
- def jgit = new org.mdonoughe.JGitDescribeTask()
|
69
|
|
- jgit.dir = gitDir
|
70
|
|
- jgit.subDir = projectDir
|
71
|
|
-
|
72
|
|
- ext.version = jgit.getDescription()
|
73
|
71
|
def targetFile = new File(buildDir, 'plugin.config')
|
74
|
|
- targetFile << "\n\nversion:\n number=${version}"
|
|
72
|
+ targetFile << "\n\nversion:\n number=${project.version}"
|
75
|
73
|
|
76
|
74
|
targetFile << "\n\nbuildenv:\n"
|
77
|
75
|
def compileConfiguration = project.configurations.getByName("compile")
|
|
@@ -117,8 +115,15 @@ subprojects {
|
117
|
115
|
into "../dist/"
|
118
|
116
|
rename ".*", "${project.name}.jar"
|
119
|
117
|
}
|
|
118
|
+
|
|
119
|
+ copy {
|
|
120
|
+ from jar.archivePath
|
|
121
|
+ into "../dist-versioned/"
|
|
122
|
+ rename ".*", "${project.name}-${project.version}.jar"
|
|
123
|
+ }
|
120
|
124
|
}
|
121
|
125
|
jar.outputs.file "../dist/${project.name}.jar"
|
|
126
|
+ jar.outputs.file "../dist-versioned/${project.name}-${project.version}.jar"
|
122
|
127
|
|
123
|
128
|
jar.dependsOn updatePluginConfig
|
124
|
129
|
}
|