[asterisk-scf-commits] asterisk-scf/integration/slice.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue Nov 9 16:59:41 CST 2010


branch "master" has been updated
       via  fb316ec83774d5a5591d61db9fa8d22712581ce1 (commit)
      from  87c2775fd8eee1e03de2c9ff35518acaa29d0300 (commit)

Summary of changes:
 build.xml             |   53 ++++++++++++++++++++++++++++++++++++++++--------
 ice-pom.xml.in        |   13 ++++++++++++
 pom.xml => pom.xml.in |    6 +----
 3 files changed, 58 insertions(+), 14 deletions(-)
 create mode 100644 ice-pom.xml.in
 rename pom.xml => pom.xml.in (83%)


- Log -----------------------------------------------------------------
commit fb316ec83774d5a5591d61db9fa8d22712581ce1
Author: David M. Lee <dlee at digium.com>
Date:   Tue Nov 9 16:54:25 2010 -0600

    Improved Java support.
    
    * Added install-ice target, for installing Ice.jar
    * Updated pom.xml file(s) to get Ice version number from slice2java
    * Added descriptions so that ant -projecthelp works properly

diff --git a/build.xml b/build.xml
index b5b8cfc..ee22a0f 100644
--- a/build.xml
+++ b/build.xml
@@ -3,6 +3,8 @@
     <property environment="env"/>
     <property name="slice2java-dir"
               value="target/generated-sources/slice2java"/>
+    <property name="generated-pom-dir"
+              value="target/tmp/pom"/>
     <property name="classes-dir" value="target/classes"/>
     <property name="javadoc-dir" value="target/javadoc"/>
 
@@ -17,7 +19,31 @@
              uri="antlib:org.apache.maven.artifact.ant"
              classpathref="maven-ant-tasks.classpath"/>
 
-    <target name="generate-sources">
+    <available property="ice-home-set" file="${env.ICE_HOME}"/>
+
+    <target name="fail-if-no-ice-home" unless="ice-home-set">
+        <fail message="ICE_HOME not set correctly (${env.ICE_HOME})"/>
+    </target>
+
+    <target name="get-ice-version" depends="fail-if-no-ice-home">
+        <exec executable="${env.ICE_HOME}/bin/slice2java"
+              outputproperty="ice-version">
+            <arg value="--version"/>
+        </exec>
+        <filter token="ice-version" value="${ice-version}"/>
+    </target>
+
+    <target name="install-ice" depends="get-ice-version"
+            description="Installs ice.jar from ICE_HOME into local Maven repo">
+        <copy file="ice-pom.xml.in" tofile="${generated-pom-dir}/ice-pom.xml"
+              filtering="true" failonerror="true"/>
+        <artifact:pom id="ice-pom" file="${generated-pom-dir}/ice-pom.xml"/>
+        <artifact:install file="${env.ICE_HOME}/lib/ice.jar"
+                          pomrefid="ice-pom"/>
+    </target>
+
+    <target name="generate-sources"
+            description="Generate .java files from .slice sources">
         <mkdir dir="${slice2java-dir}"/>
         <slice2java outputdir="${slice2java-dir}">
             <fileset dir=".">
@@ -30,7 +56,8 @@
         </slice2java>
     </target>
 
-    <target name="compile" depends="generate-sources">
+    <target name="compile" depends="generate-sources"
+            description="Compiles generated .java files">
         <mkdir dir="${classes-dir}"/>
         <javac srcdir="${slice2java-dir}" destdir="${classes-dir}">
             <classpath>
@@ -39,7 +66,8 @@
         </javac>
     </target>
 
-    <target name="doc" depends="generate-sources">
+    <target name="doc" depends="generate-sources"
+            description="Generates javadocs for generated .java files">
         <mkdir dir="${javadoc-dir}"/>
         <javadoc sourcepath="${slice2java-dir}" destdir="${javadoc-dir}" use="true"
                  verbose="false">
@@ -49,7 +77,8 @@
         </javadoc>
     </target>
 
-    <target name="package" depends="compile,doc">
+    <target name="package" depends="compile,doc"
+            description="Packages binaries, sources and javadoc .jar's">
         <jar jarfile="target/asterisk-scf-api.jar" basedir="${classes-dir}"/>
         <jar jarfile="target/asterisk-scf-api-sources.jar"
              basedir="${slice2java-dir}"/>
@@ -57,15 +86,21 @@
              basedir="${javadoc-dir}"/>
     </target>
 
-    <target name="install" depends="package">
-        <artifact:pom id="pom" file="pom.xml"/>
+    <target name="install" depends="package,get-ice-version"
+            description="installs packages into local Maven repo">
+        <copy file="pom.xml.in" tofile="${generated-pom-dir}/pom.xml"
+              filtering="true" failonerror="true"/>
+        <artifact:pom id="pom" file="${generated-pom-dir}/pom.xml"/>
         <artifact:install file="target/asterisk-scf-api.jar" pomrefid="pom">
-            <attach file="target/asterisk-scf-api-sources.jar" classifier="sources"/>
-            <attach file="target/asterisk-scf-api-javadoc.jar" classifier="javadoc"/>
+            <attach file="target/asterisk-scf-api-sources.jar"
+                    classifier="sources"/>
+            <attach file="target/asterisk-scf-api-javadoc.jar"
+                    classifier="javadoc"/>
         </artifact:install>
     </target>
 
-    <target name="clean">
+    <target name="clean"
+            description="Clean">
         <delete dir="target"/>
     </target>
 </project>
diff --git a/ice-pom.xml.in b/ice-pom.xml.in
new file mode 100644
index 0000000..d420b49
--- /dev/null
+++ b/ice-pom.xml.in
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+                      http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.zeroc</groupId>
+    <artifactId>ice</artifactId>
+    <version>@ice-version at -digium</version>
+
+    <name>Ice for Java</name>
+</project>
diff --git a/pom.xml b/pom.xml.in
similarity index 83%
rename from pom.xml
rename to pom.xml.in
index eaf2be7..c8aed7a 100644
--- a/pom.xml
+++ b/pom.xml.in
@@ -15,11 +15,7 @@
         <dependency>
             <groupId>com.zeroc</groupId>
             <artifactId>ice</artifactId>
-            <version>${ice.version}</version>
+            <version>@ice-version at -digium</version>
         </dependency>
     </dependencies>
-
-    <properties>
-        <ice.version>3.4.1-dgm01</ice.version>
-    </properties>
 </project>

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/slice.git



More information about the asterisk-scf-commits mailing list