[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [metrics-lib/master] Add new Ant tasks for putting out releases.



commit 1cfe054501ceb4758052a44ed199e0fbc6423c67
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Fri Nov 27 17:14:50 2015 +0100

    Add new Ant tasks for putting out releases.
    
    Again based on feedback by iwakeh on #13166.
---
 .gitignore |    4 ++-
 CERT       |   18 +++++++++++++
 LICENSE    |    4 +--
 build.xml  |   86 +++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 4 files changed, 99 insertions(+), 13 deletions(-)

diff --git a/.gitignore b/.gitignore
index b57524b..ff410d7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,8 @@
 classes/
 lib/
-descriptor.jar
+descriptor-*.jar
+descriptor-*.tar.gz
 .classpath
 .project
+build.properties
 
diff --git a/CERT b/CERT
new file mode 100644
index 0000000..3683158
--- /dev/null
+++ b/CERT
@@ -0,0 +1,18 @@
+-----BEGIN CERTIFICATE-----
+MIIDbTCCAlWgAwIBAgIEOUQZDTANBgkqhkiG9w0BAQsFADBnMQswCQYDVQQGEwJVUzELMAkGA1UE
+CBMCTUExEjAQBgNVBAcTCUNhbWJyaWRnZTEdMBsGA1UEChMUVGhlIFRvciBQcm9qZWN0LCBJbmMx
+GDAWBgNVBAMTD0thcnN0ZW4gTG9lc2luZzAeFw0xNTExMjAxMTUzNTFaFw0xNjAyMTgxMTUzNTFa
+MGcxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJNQTESMBAGA1UEBxMJQ2FtYnJpZGdlMR0wGwYDVQQK
+ExRUaGUgVG9yIFByb2plY3QsIEluYzEYMBYGA1UEAxMPS2Fyc3RlbiBMb2VzaW5nMIIBIjANBgkq
+hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgJCqHFgEhyj8AI4w93YcyZEkKwn2Jw5t7bYcaLieP0wa
+Ai2xrRFROo0eofjIllPlYTFtj9jLAZf+MQ1/Sdv7SLdlpasBCS0deTGlxuMzyMP9ztkkkAeibc+F
+IXYPJArwGJiycnd+obW8b8KNrJQsnb0Se5Fdgo/PSu1rqMh/Mylv9vLqUzB4hbN4bg5+7THlTAOK
+egYyR0NEPDzi327MAvzzle27kXV9yOCQr01zXW9NeWYed6JMXCZwaMN6nTVEFiwTfAyATfPncarf
+gZ1kyAkQ6/Sw2bGMv8jHqB63Ka0/6GXHRbFgCeWU+c/1sfEMBD3ZurEjwSjWGl73E4GBswIDAQAB
+oyEwHzAdBgNVHQ4EFgQUJbu6UT97IU4utjyc4zYUrLIgzvQwDQYJKoZIhvcNAQELBQADggEBADT/
+QEbkx0tVKWWkeahVBt76LG50iO0OQ5dP3SCdhZoudt7jIFifrAcGlOG6vAKXT6/dAhDkKiKXzxQo
+8mt3wdkN4sIZDuXroJ+42s6ZED2L1HP6/daLlwaAfnx0b9LAAGKF7CMqxgPpiqiJ3K4LB4I1kFRJ
+uzjy+/XTOR9aF5o0AGAb5jMmv/BtVu2cH+UgixH/FVhyfZekja2OAN/N2VE0BuzJEDApEJ9p9j5I
+CRzeAuvOGT1CIEJR/fAuM5WZN6rD8nB7zwGCZP/RKvRdw0m89wMvHnvRvPZchSVf2PNoNy2GoqN6
+nWsS1VYgwYfyGV+br7U+YKCoKTKJ1jRxpAs=
+-----END CERTIFICATE-----
diff --git a/LICENSE b/LICENSE
index d5b67cd..9040894 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright 2011 The Tor Project
+Copyright 2011--2015 The Tor Project
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
@@ -12,7 +12,7 @@ met:
   in the documentation and/or other materials provided with the
   distribution.
 
-  * Neither the names of the copyright owners nor the names of its
+* Neither the names of the copyright owners nor the names of its
   contributors may be used to endorse or promote products derived from
   this software without specific prior written permission.
 
diff --git a/build.xml b/build.xml
index 4aaf8f7..e80109d 100644
--- a/build.xml
+++ b/build.xml
@@ -1,27 +1,37 @@
 <project default="jar" name="descriptor" basedir=".">
+  <property name="release.version" value="1.0.0" />
   <property name="sources" value="src"/>
   <property name="classes" value="classes"/>
   <property name="tests" value="test"/>
-  <property name="jarfile" value="descriptor.jar" />
+  <property name="libs" value="lib"/>
+  <property name="jarfile" value="descriptor-${release.version}.jar" />
+  <property name="jarsourcesfile"
+            value="descriptor-${release.version}-sources.jar" />
   <property name="source-and-target-java-version" value="1.6" />
+  <property name="release.tarball"
+            value="descriptor-${release.version}.tar.gz" />
+  <property file="build.properties" />
 
   <path id="classpath">
     <pathelement path="${classes}"/>
-    <fileset dir="/usr/share/java">
+    <fileset dir="${libs}">
       <include name="commons-compress-1.4.1.jar"/>
       <include name="junit4-4.10.jar"/>
+      <include name="hamcrest-core-1.2.jar"/>
     </fileset>
   </path>
 
-  <target name="init">
-    <mkdir dir="${classes}"/>
-  </target>
-
   <target name="clean" >
     <delete includeEmptyDirs="true">
       <fileset dir="${classes}" defaultexcludes="false" includes="**" />
     </delete>
     <delete file="${jarfile}"/>
+    <delete file="${jarsourcesfile}"/>
+    <delete file="${release.tarball}"/>
+  </target>
+
+  <target name="init">
+    <mkdir dir="${classes}"/>
   </target>
 
   <target name="compile"
@@ -38,10 +48,7 @@
       <classpath refid="classpath"/>
     </javac>
   </target>
-  <target name="jar" depends="compile">
-    <jar destfile="${jarfile}"
-         basedir="${classes}"/>
-  </target>
+
   <target name="test" depends="compile">
     <javac destdir="${classes}"
            srcdir="${tests}"
@@ -63,5 +70,64 @@
       </batchtest>
     </junit>
   </target>
+
+  <target name="jar" depends="compile">
+    <exec executable="git" outputproperty="git.revision">
+      <arg value="rev-parse" />
+      <arg value="--short" />
+      <arg value="HEAD" />
+    </exec>
+    <jar destfile="${jarfile}"
+         basedir="${classes}">
+      <manifest>
+        <attribute name="Created-By" value="The Tor Project" />
+        <attribute name="Implementation-Title" value="DescripTor"/>
+        <attribute name="Implementation-Version"
+                   value="${release.version}-${git.revision}"/>
+      </manifest>
+    </jar>
+    <jar destfile="${jarsourcesfile}">
+      <fileset dir="${sources}" />
+      <fileset dir="${tests}"/>
+      <manifest>
+        <attribute name="Created-By" value="The Tor Project" />
+        <attribute name="Implementation-Title" value="DescripTor"/>
+        <attribute name="Implementation-Version"
+                   value="${release.version}-${git.revision}"/>
+      </manifest>
+    </jar>
+  </target>
+
+  <target name="signjar" depends="jar">
+    <signjar alias="${jarsigner.alias}"
+             storepass="${jarsigner.storepass}"
+             sigalg="SHA256withRSA"
+             digestalg="SHA-256"
+             tsaurl="http://timestamp.digicert.com";>
+      <path>
+        <pathelement path="${jarfile}"/>
+        <pathelement path="${jarsourcesfile}"/>
+      </path>
+    </signjar>
+  </target>
+
+  <target name="tar" depends="signjar">
+    <tar destfile="${release.tarball}" compression="gzip">
+      <tarfileset dir="." prefix="descriptor-${release.version}">
+        <include name="${jarfile}" />
+        <include name="${jarsourcesfile}" />
+        <include name="build.xml" />
+        <include name="LICENSE" />
+        <include name="CERT" />
+        <include name="*.md" />
+      </tarfileset>
+      <tarfileset dir="${sources}"
+                  prefix="descriptor-${release.version}/src" />
+      <tarfileset dir="${tests}"
+                  prefix="descriptor-${release.version}/test" />
+      <tarfileset dir="${libs}"
+                  prefix="descriptor-${release.version}/lib" />
+    </tar>
+  </target>
 </project>
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits