ソースを参照

Set versions on plugins properly.

This makes the plugins include their version in the output file
name, and when used as a dependency.

Also create a dist-versioned directory which accumulates versioned
plugins.
pull/130/head
Chris Smith 9年前
コミット
e52b618278
2個のファイルの変更14行の追加8行の削除
  1. 1
    0
      .gitignore
  2. 13
    8
      build.gradle

+ 1
- 0
.gitignore ファイルの表示

@@ -1,6 +1,7 @@
1 1
 /build
2 2
 */build
3 3
 /dist
4
+/dist-versioned
4 5
 /lib
5 6
 *.iml
6 7
 /.gradle

+ 13
- 8
build.gradle ファイルの表示

@@ -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
 }

読み込み中…
キャンセル
保存