Author: gtrasuk
Date: Wed Jan 13 06:14:56 2016
New Revision: 1724357

URL: http://svn.apache.org/viewvc?rev=1724357&view=rev
Log:
rat_reports.sh was updated to reference latest version of Apache RAT (0.11).

deploy_river.groovy now has '-install' and '-dryrun' options, as well as 
'-help'.  It's
also written more idiomatically groovy-ish, and doesn't include a version 
number for the uploads, since
that's in the pom files.  As a result, the same file can be used in the 2.2 
branch and in the trunk, and 
it won't need to be updated as the versions increment (just the pom files need 
to be rev'd).

Modified:
    river/jtsk/branches/2.2/poms/deploy_river.groovy
    river/jtsk/branches/2.2/rat_reports.sh

Modified: river/jtsk/branches/2.2/poms/deploy_river.groovy
URL: 
http://svn.apache.org/viewvc/river/jtsk/branches/2.2/poms/deploy_river.groovy?rev=1724357&r1=1724356&r2=1724357&view=diff
==============================================================================
--- river/jtsk/branches/2.2/poms/deploy_river.groovy (original)
+++ river/jtsk/branches/2.2/poms/deploy_river.groovy Wed Jan 13 06:14:56 2016
@@ -14,12 +14,32 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-String version = "2.2.3"
-String rootDir = ".."
-String repositoryId="apache.releases.https"
-String 
repositoryURL="https://repository.apache.org/service/local/staging/deploy/maven2";
+
+def cli = new CliBuilder(usage:'deploy_river.groovy',
+                          header:'Options:')
+cli.help('print this message')
+cli.install('install locally, don\'t deploy to repository')
+cli.dryrun('dryrun - just show the actions, but don\'t do them')
+    
+println("Args are $args")
+
+def options = cli.parse(args)
+
+if (options.hasOption("help")) {
+    println(cli.usage())
+    return ""
+}
+
+def rootDir = ".."
+def repositoryId="apache.releases.https"
+def 
repositoryURL="https://repository.apache.org/service/local/staging/deploy/maven2";
+// To test locally, you can use a file url, as below...
 //String repositoryURL="file:///Users/trasukg/mvn-repo"
-String passphrase="Insert passphrase here..."
+
+def passphrase
+if (!options.hasOption("install")) {
+    passphrase=System.console().readLine "Enter your GPG passphrase: "
+}
         
 ["net.jini:jsk-platform":"lib",
  "net.jini:jsk-lib":"lib",
@@ -39,58 +59,53 @@ String passphrase="Insert passphrase her
  "org.apache.river:outrigger-dl":"lib-dl",
  "org.apache.river:reggie":"lib",
  "org.apache.river:reggie-dl":"lib-dl",
- "org.apache.river:start":"lib"
+ "org.apache.river:start":"lib",
  "org.apache.river:tools":"lib"
 ].each {artifact, subDir ->
     
-    String[] parts = artifact.split(":")
-    String gId = parts[0]
-    String aId = parts[1]
-    String dir = rootDir+"/"+subDir
-    /*String deployCommand = "mvn deploy:deploy-file "+
-                           "-DrepositoryId=apache.releases.https "+
-                           "-Dversion=${version} "+
-                           "-DgeneratePom=false -Dpackaging=jar "+
-                           "-DgroupId=${gId} "+
-                           "-DartifactId=${aId} "+
-                           "-Dfile=${dir}/${aId}.jar "+
-                           "-DpomFile=./${aId}.pom "+
-                           
"-Durl=https://repository.apache.org/service/local/staging/deploy/maven2";
-    */
-    def deployCommand = [\
-        "mvn",
-        "gpg:sign-and-deploy-file",
-        "-DpomFile=${aId}.pom",
-        "-Dfile=${dir}/${aId}.jar",
-        "-DrepositoryId=${repositoryId}",
-       "-Durl=${repositoryURL}",
-        "-Dgpg.useAgent=false",
-       "[email protected]",
-        "-Dgpg.passphrase=${passphrase}"
-    ]
-    /*
-       
-        /*"-Drepository=${repository} " +
-       
-       
-    */
-/*
-"mvn gpg:sign-and-deploy-file " +
-       "-Dpassphrase='insert passphrase here' " +
-       "-DpomFile=./${aId}.pom " +
-       "-Dfile=${dir}/${aId}.jar " + 
-       "-DrepositoryId=${repository} " +
-       "-Durl=${repositoryURL}"
-*/
-    /* First make sure the jar file contains the LICENSE file */
-    def p="jar uvf ${dir}/${aId}.jar -C .. LICENSE".execute()
-    p.consumeProcessOutputStream(System.out)
-    p.consumeProcessErrorStream(System.err)
-    p.waitFor()
+    def parts = artifact.split(":")
+    def gId = parts[0]
+    def aId = parts[1]
+    def dir = rootDir+"/"+subDir
+
+    def deployCommand
     
-    println deployCommand
-    Process process = deployCommand.execute()
-    process.consumeProcessOutputStream(System.out)
-    process.consumeProcessErrorStream(System.err)
-    process.waitFor()
+    if (options.hasOption("install")) {
+        /*    mvn install:install-file -Dfile=<path-to-file> 
-DgroupId=<group-id> \
+            -DartifactId=<artifact-id> -Dversion=<version> 
-Dpackaging=<packaging>
+        */
+        deployCommand = [\
+            "mvn",
+            "install:install-file",
+            "-DpomFile=${aId}.pom",
+            "-Dfile=${dir}/${aId}.jar"
+        ]
+    } else {
+        deployCommand = [\
+            "mvn",
+            "gpg:sign-and-deploy-file",
+            "-DpomFile=${aId}.pom",
+            "-Dfile=${dir}/${aId}.jar",
+            "-DrepositoryId=${repositoryId}",
+            "-Durl=${repositoryURL}",
+            "-Dgpg.useAgent=false",
+            "[email protected]",
+            "-Dgpg.passphrase=${passphrase}"
+        ]
+
+    }
+    /* First make sure the jar file contains the LICENSE file */
+    if (!options.hasOption('dryrun')) {
+        def p="jar uvf ${dir}/${aId}.jar -C .. LICENSE".execute()
+        p.consumeProcessOutputStream(System.out)
+        p.consumeProcessErrorStream(System.err)
+        p.waitFor()
+        
+        Process process = deployCommand.execute()
+        process.consumeProcessOutputStream(System.out)
+        process.consumeProcessErrorStream(System.err)
+        process.waitFor()
+    } else {
+        println deployCommand
+    }
 }

Modified: river/jtsk/branches/2.2/rat_reports.sh
URL: 
http://svn.apache.org/viewvc/river/jtsk/branches/2.2/rat_reports.sh?rev=1724357&r1=1724356&r2=1724357&view=diff
==============================================================================
--- river/jtsk/branches/2.2/rat_reports.sh (original)
+++ river/jtsk/branches/2.2/rat_reports.sh Wed Jan 13 06:14:56 2016
@@ -17,6 +17,7 @@
 # limitations under the License.
 #
 
+RAT_VERSION=0.11
 if [ "${RAT_HOME+x}" = "x" ]; then
        echo "Using RAT_HOME=${RAT_HOME}"
 else
@@ -24,6 +25,7 @@ else
        exit 1
 fi
 
-java -jar $RAT_HOME/apache-rat-0.8.jar -d src > RAT_REPORT_src.txt
-java -jar $RAT_HOME/apache-rat-0.8.jar -d examples -e *.mf > 
RAT_REPORT_examples.txt
-java -jar $RAT_HOME/apache-rat-0.8.jar -d qa/jtreg -e *.mf > 
RAT_REPORT_qa_jtreg.txt
+java -jar $RAT_HOME/apache-rat-$RAT_VERSION.jar -d src -e *.mf > 
RAT_REPORT_src.txt
+java -jar $RAT_HOME/apache-rat-$RAT_VERSION.jar -d examples -e *.mf > 
RAT_REPORT_examples.txt
+java -jar $RAT_HOME/apache-rat-$RAT_VERSION.jar -d qa/jtreg -e *.mf > 
RAT_REPORT_qa_jtreg.txt
+java -jar $RAT_HOME/apache-rat-$RAT_VERSION.jar -d qa/src -e *.mf > 
RAT_REPORT_qa.txt


Reply via email to