Author: markt
Date: Wed Jun 25 19:11:03 2014
New Revision: 1605561

URL: http://svn.apache.org/r1605561
Log:
Add the initial hooks to get the Windows binaries signed by Symantec's code 
signing service. This work is still at the evaluation stage.

Added:
    tomcat/trunk/java/org/apache/tomcat/buildutil/SignCode.java   (with props)
Modified:
    tomcat/trunk/build.xml

Modified: tomcat/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/build.xml?rev=1605561&r1=1605560&r2=1605561&view=diff
==============================================================================
--- tomcat/trunk/build.xml (original)
+++ tomcat/trunk/build.xml Wed Jun 25 19:11:03 2014
@@ -2088,8 +2088,25 @@ Apache Tomcat ${version} native binaries
     </antcall>
   </target>
 
+  <target name="sign-windows-binaries" depends="installer">
+
+    <taskdef name="signcode"
+             classname="org.apache.tomcat.buildutil.SignCode"
+             classpath="${tomcat.classes}" />
+
+    <signcode>
+      <fileset dir="${tomcat.release}">
+        <filename name="v${version}/bin/${final.name}.exe"/>
+      </fileset>
+      <fileset dir="${tomcat.dist}/bin">
+        <include name="**/*.exe"/>
+      </fileset>
+    </signcode>
+
+  </target>
+
   <target name="release"
-    
depends="clean,release-init,dist-deployer,installer,package-zip,package-winzip,package-tgz,package-deployer-zip,package-deployer-tgz,javadoc,package-docs-tgz,package-src-zip,package-src-tgz,package-src-jar"
+    
depends="clean,release-init,dist-deployer,sign-windows-binaries,package-zip,package-winzip,package-tgz,package-deployer-zip,package-deployer-tgz,javadoc,package-docs-tgz,package-src-zip,package-src-tgz,package-src-jar"
     description="Create a Tomcat packaged distribution">
 
     <copy file="KEYS"

Added: tomcat/trunk/java/org/apache/tomcat/buildutil/SignCode.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/buildutil/SignCode.java?rev=1605561&view=auto
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/buildutil/SignCode.java (added)
+++ tomcat/trunk/java/org/apache/tomcat/buildutil/SignCode.java Wed Jun 25 
19:11:03 2014
@@ -0,0 +1,61 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.tomcat.buildutil;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.types.FileSet;
+
+/**
+ * Ant task that submits a file to the Symantec code-signing service.
+ */
+public class SignCode extends Task {
+
+    private final List<FileSet> filesets = new ArrayList<>();
+
+
+    public void addFileset(FileSet fileset) {
+        filesets.add(fileset);
+    }
+
+
+    @Override
+    public void execute() throws BuildException {
+
+        List<File> filesToSign = new ArrayList<>();
+
+        // Process the filesets and populate the list of files that need to be
+        // signed.
+        for (FileSet fileset : filesets) {
+            DirectoryScanner ds = fileset.getDirectoryScanner(getProject());
+            File basedir = ds.getBasedir();
+            String[] files = ds.getIncludedFiles();
+            if (files.length > 0) {
+                for (int i = 0; i < files.length; i++) {
+                    File file = new File(basedir, files[i]);
+                    filesToSign.add(file);
+                    log("TODO: Sign " + file.getAbsolutePath());
+                }
+            }
+        }
+    }
+}

Propchange: tomcat/trunk/java/org/apache/tomcat/buildutil/SignCode.java
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to