activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r590994 - in /activemq/activemq-dotnet/Apache.NMS.EMS/trunk: lib/all/ nant-common.xml nant.build
Date Thu, 01 Nov 2007 13:17:58 GMT
Author: chirino
Date: Thu Nov  1 06:17:58 2007
New Revision: 590994

URL: http://svn.apache.org/viewvc?rev=590994&view=rev
Log:
Updated nant build to use maven style dependency downloading

Removed:
    activemq/activemq-dotnet/Apache.NMS.EMS/trunk/lib/all/
Modified:
    activemq/activemq-dotnet/Apache.NMS.EMS/trunk/nant-common.xml
    activemq/activemq-dotnet/Apache.NMS.EMS/trunk/nant.build

Modified: activemq/activemq-dotnet/Apache.NMS.EMS/trunk/nant-common.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.EMS/trunk/nant-common.xml?rev=590994&r1=590993&r2=590994&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.EMS/trunk/nant-common.xml (original)
+++ activemq/activemq-dotnet/Apache.NMS.EMS/trunk/nant-common.xml Thu Nov  1 06:17:58 2007
@@ -39,7 +39,77 @@
   <property name="current.build.framework" value="${framework::get-target-framework()}"/>
   <property name="current.build.defines"   value="${build.defines}" />
 
-  <!-- Helper targets used to enable build configurations -->
+  <!-- Figure out the user's HOME directory --> 
+  <property name="user.home" value="${environment::get-variable('HOME')}"
+            if="${environment::variable-exists('HOME') and platform::is-unix()}"
+            unless="${property::exists('user.home')}"/>
+  <property name="user.home" value="${environment::get-variable('USERPROFILE')}"
+            if="${environment::variable-exists('USERPROFILE') and platform::is-win32()}"
+            unless="${property::exists('user.home')}"/>
+            
+  <fail message="The HOME environment variable is not defined.  Please set it to your
home directory."
+            unless="${property::exists('user.home')}" if="${platform::is-unix()}"/>
+  <fail message="The USERPROFILE environment variable is not defined.  Please set it to
your home directory."
+            unless="${property::exists('user.home')}" if="${platform::is-win32()}"/>
+            
+  <!-- Figure out the NANT repositories--> 
+  <property name="nant.repo" value="${environment::get-variable('NANT_REPO')}"
+            if="${environment::variable-exists('NANT_REPO')}"
+            unless="${property::exists('nant.repo')}"/>
+  <property name="nant.local.repo" value="${user.home}/.nant/repository"
+            unless="${property::exists('nant.local.repo')}"/>
+
+  <property name="nant.remote.repo" value="${environment::get-variable('NANT_REMOTE_REPO')}"
+                      if="${environment::variable-exists('NANT_REMOTE_REPO')}"
+                      unless="${property::exists('nant.remote.repo')}"/>             
        
+  <property name="nant.remote.repo" value="http://people.apache.org/~chirino/nant-repo"
+          unless="${property::exists('nant.remote.repo')}"/>
+          
+  <!-- Nant Repo Tasks -->
+  <target name="repo-download" description="Download a dependency from the remote repo
to the local repo">
+    <fail message="The repo.task.artifact variable has not been set.  Please set it before
you call this task." unless="${property::exists('repo.task.artifact')}"/>
+
+    <property name="repo.task.src" value="${nant.remote.repo}/${repo.task.artifact}"/>
  
+    <property name="repo.task.dest" value="${nant.local.repo}/${repo.task.artifact}"/>
  
+
+    <property name="repo.task.download" value="false"/>   
+    <if test="${not file::exists(repo.task.dest)}">
+      <property name="repo.task.download" value="true"/>   
+    </if>
+    
+    <if test="${file::exists(repo.task.dest)}">
+      <!-- TODO: we could also download if the file is a SNAPSHOT and is stale -->
+      <property name="repo.task.download" value="false"/>   
+      <echo message="Artifact: ${nant.remote.repo}/${repo.task.artifact} is up to date."/>
+    </if>
+    
+    <if test="${repo.task.download}">
+      <echo message="Downloading artifact: ${repo.task.src}"/>
+      <mkdir dir="${directory::get-parent-directory(repo.task.dest)}" />
+      <get src="${repo.task.src}" dest="${repo.task.dest}"/>
+    </if>   
+  </target>
+  
+  <target name="repo-install" description="Install a dependency to the local repo">
+    <fail message="The repo.task.artifact variable has not been set.  Please set it before
you call this task." unless="${property::exists('repo.task.artifact')}"/>
+    <fail message="The repo.task.src variable has not been set.  Please set it before
you call this task." unless="${property::exists('repo.task.src')}"/>
+        
+    <property name="repo.task.dest" value="${nant.local.repo}/${repo.task.artifact}"/>
  
+    <mkdir dir="${directory::get-parent-directory(repo.task.dest)}" />
+    <copy file="${repo.task.src}" tofile="${repo.task.dest}"/>    
+  </target>
+
+  <target name="repo-deploy" description="Deploy a dependency to the deployment repo">
    
+    <fail message="Then nant.deploy.repo variable has not been set.  Please set it before
you call this task." unless="${property::exists('nant.deploy.repo')}"/>
+    <fail message="The repo.task.artifact variable has not been set.  Please set it before
you call this task." unless="${property::exists('repo.task.artifact')}"/>
+    <fail message="The repo.task.src variable has not been set.  Please set it before
you call this task." unless="${property::exists('repo.task.src')}"/>
+        
+    <property name="repo.task.dest" value="${nant.deploy.repo}/${repo.task.artifact}"/>
  
+    <mkdir dir="${directory::get-parent-directory(repo.task.dest)}" />
+    <copy file="${repo.task.src}" tofile="${repo.task.dest}"/>    
+  </target>
+    
+<!-- Helper targets used to enable build configurations -->
   <target name="set-noskip-configuration" description="Disable skiping builds">
     <property name="project.noskip"         value="true" />
   </target>
@@ -361,7 +431,113 @@
       <references refid="test.dependencies"/>
     </csc>
   </target>
+  
+  
+  <!-- ============================================================================================
-->
+  <!--      I N S T A L L     T A R G E T S                                          
              -->
+  <!-- ============================================================================================
-->
+
+  <target name="install-all" depends="release-init" description="Install all build configurations
for all runtime configurations">
+    <echo message="Installing all build configurations for all runtime configurations."
/>
+    <call target="set-debug-configuration" />
+    <call target="set-net-1.0-framework-configuration"  /><call target="conditional-install"
/>
+    <call target="set-net-2.0-framework-configuration"  /><call target="conditional-install"
/>
+    <call target="set-mono-1.0-framework-configuration" /><call target="conditional-install"
/>
+    <call target="set-mono-2.0-framework-configuration" /><call target="conditional-install"
/>
+    <call target="set-netcf-1.0-framework-configuration"/><call target="conditional-install"
/>
+    <call target="set-netcf-2.0-framework-configuration"/><call target="conditional-install"
/>
+
+    <!-- we can only do a release skip if the Key file is available -->
+    <if test="${not build.skip.release}">
+      <call target="set-release-configuration" />
+      <call target="set-net-1.0-framework-configuration"  /><call target="conditional-install"
/>
+      <call target="set-net-2.0-framework-configuration"  /><call target="conditional-install"
/>
+      <call target="set-mono-1.0-framework-configuration" /><call target="conditional-install"
/>
+      <call target="set-mono-2.0-framework-configuration" /><call target="conditional-install"
/>
+      <call target="set-netcf-1.0-framework-configuration"/><call target="conditional-install"
/>
+      <call target="set-netcf-2.0-framework-configuration"/><call target="conditional-install"
/>
+    </if>
+  </target>
+  
+  <target name="conditional-install" depends="init" unless="${build.skip}"
+      description="Conditionaly install all the modules if build framework and type are supported">
+    <call target="install" />
+  </target>
+  
+  <!-- Install the modules to the local repo -->
+  <target name="install" depends="compile" description="Install the artifacts into the
nant repo">
+    <property name="path" value="${project.group}/${project.name}/${project.version.full}/${current.build.framework}/${current.build.config}"/>
   
+
+    <property name="repo.task.artifact" value="${path}/${project.name}.dll"/>    
+    <property name="repo.task.src" value="${build.bin.dir}/${project.name}.dll"/> 
  
+    <call target="repo-install"/>
+    <property name="repo.task.artifact" value="${path}/${project.name}.xml"/>    
+    <property name="repo.task.src" value="${build.bin.dir}/${project.name}.xml"/> 
  
+    <call target="repo-install"/>
+    <property name="repo.task.artifact" value="${path}/${project.name}.Test.dll"/>
   
+    <property name="repo.task.src" value="${build.bin.dir}/${project.name}.Test.dll"/>
   
+    <call target="repo-install"/>
+    <property name="repo.task.artifact" value="${path}/${project.name}.Test.xml"/>
   
+    <property name="repo.task.src" value="${build.bin.dir}/${project.name}.Test.xml"/>
   
+    <call target="repo-install"/>
+    
+  </target>
+
+  <!-- ============================================================================================
-->
+  <!--      D E P L O Y     T A R G E T S                                            
              -->
+  <!-- ============================================================================================
-->
+
+  <target name="deploy-all" depends="release-init" description="Deploy all build configurations
for all runtime configurations">
+    
+    <echo message="Deploying all build configurations for all runtime configurations."
/>
+
+    <call target="set-debug-configuration" />
+    <call target="set-net-1.0-framework-configuration"  /><call target="conditional-deploy"
/>
+    <call target="set-net-2.0-framework-configuration"  /><call target="conditional-deploy"
/>
+    <call target="set-mono-1.0-framework-configuration" /><call target="conditional-deploy"
/>
+    <call target="set-mono-2.0-framework-configuration" /><call target="conditional-deploy"
/>
+    <call target="set-netcf-1.0-framework-configuration"/><call target="conditional-deploy"
/>
+    <call target="set-netcf-2.0-framework-configuration"/><call target="conditional-deploy"
/>
 
+    <!-- we can only do a release skip if the Key file is available -->
+    <if test="${not build.skip.release}">
+      <call target="set-release-configuration" />
+      <call target="set-net-1.0-framework-configuration"  /><call target="conditional-deploy"
/>
+      <call target="set-net-2.0-framework-configuration"  /><call target="conditional-deploy"
/>
+      <call target="set-mono-1.0-framework-configuration" /><call target="conditional-deploy"
/>
+      <call target="set-mono-2.0-framework-configuration" /><call target="conditional-deploy"
/>
+      <call target="set-netcf-1.0-framework-configuration"/><call target="conditional-deploy"
/>
+      <call target="set-netcf-2.0-framework-configuration"/><call target="conditional-deploy"
/>
+    </if>
+  </target>
+  
+  <target name="conditional-deploy" depends="init" unless="${build.skip}"
+      description="Conditionaly deploy all the modules if build framework and type are supported">
+    <call target="deploy" />
+  </target>
+  
+  <target name="init-deploy">
+     <fail message="Then nant.deploy.repo variable has not been set.  Please set it before
you call this task." unless="${property::exists('nant.deploy.repo')}"/>
+  </target>
+  
+  <!-- Install the modules to the local repo -->
+  <target name="deploy" depends="init-deploy, compile" description="Deploy the artifacts
into the nant repo">
+    <property name="path" value="${project.group}/${project.name}/${project.version.full}/${current.build.framework}/${current.build.config}"/>
   
+
+    <property name="repo.task.artifact" value="${path}/${project.name}.dll"/>    
+    <property name="repo.task.src" value="${build.bin.dir}/${project.name}.dll"/> 
  
+    <call target="repo-deploy"/>
+    <property name="repo.task.artifact" value="${path}/${project.name}.xml"/>    
+    <property name="repo.task.src" value="${build.bin.dir}/${project.name}.xml"/> 
  
+    <call target="repo-deploy"/>
+    <property name="repo.task.artifact" value="${path}/${project.name}.Test.dll"/>
   
+    <property name="repo.task.src" value="${build.bin.dir}/${project.name}.Test.dll"/>
   
+    <call target="repo-deploy"/>
+    <property name="repo.task.artifact" value="${path}/${project.name}.Test.xml"/>
   
+    <property name="repo.task.src" value="${build.bin.dir}/${project.name}.Test.xml"/>
   
+    <call target="repo-deploy"/>
+    
+  </target>
     
   <!-- ============================================================================================
-->
   <!--      M I S C E L L A N E O U S    T A R G E T S                               
              -->

Modified: activemq/activemq-dotnet/Apache.NMS.EMS/trunk/nant.build
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.EMS/trunk/nant.build?rev=590994&r1=590993&r2=590994&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.EMS/trunk/nant.build (original)
+++ activemq/activemq-dotnet/Apache.NMS.EMS/trunk/nant.build Thu Nov  1 06:17:58 2007
@@ -24,6 +24,8 @@
            value="${project::get-base-directory()}"/>
   <property name="project.name"
            value="Apache.NMS.EMS"/>
+  <property name="project.group"
+           value="org.apache.activemq"/>
   <property name="project.version"
            value="1.0" unless="${property::exists('project.version')}"/>
   <property name="project.short_description"
@@ -33,22 +35,36 @@
   <!-- The EMS module is not CLS complicant yet -->
   <property name="project.cls.compliant" value="false"/>
 
+  <!-- Repository organized as: organization/module/version/plaform/artifact, platform
might be something like 'all' or 'net-2.0/release' -->
+  <property name="nunit.dll" value="org.nunit/nunit/2.2.8/all/nunit.framework.dll"/>
   
+  <property name="Apache.NMS.dll" value="${project.group}/Apache.NMS/1.0-SNAPSHOT/${current.build.framework}/${current.build.config}/Apache.NMS.dll"
dynamic="true"/>    
+  <property name="Apache.NMS.Test.dll" value="${project.group}/Apache.NMS/1.0-SNAPSHOT/${current.build.framework}/${current.build.config}/Apache.NMS.Test.dll"
dynamic="true"/>    
+
   <target name="dependency-init" description="Initializes build dependencies">
+  
+    <!-- The following does a poor man's maven style dependency install to the local repo
-->
+    <property name="repo.task.artifact" value="${nunit.dll}"/>    
+    <call target="repo-download"/>
+    <property name="repo.task.artifact" value="${Apache.NMS.dll}"/>    
+    <call target="repo-download"/>
+    <property name="repo.task.artifact" value="${Apache.NMS.Test.dll}"/>    
+    <call target="repo-download"/>
+  
   	<assemblyfileset failonempty="true" id="dependencies">
       <include name="mscorlib.dll" asis="true"/>
       <include name="System.dll" asis="true"/>
       <include name="${lib.dir}/TIBCO.EMS.dll"/>
-      <include name="${lib.dir}/Apache.NMS.dll"/>
+      <include name="${nant.local.repo}/${Apache.NMS.dll}"/>
   	</assemblyfileset>
   	
   	<assemblyfileset failonempty="true" id="test.dependencies">
       <include name="mscorlib.dll" asis="true"/>
       <include name="System.dll" asis="true"/>
       <include name="${lib.dir}/TIBCO.EMS.dll"/>
-      <include name="${lib.dir}/Apache.NMS.dll"/>
-      <include name="${lib.dir}/Apache.NMS.Test.dll"/>
+      <include name="${nant.local.repo}/${Apache.NMS.dll}"/>
+      <include name="${nant.local.repo}/${Apache.NMS.Test.dll}"/>
       <include name="${build.bin.dir}/${project.name}.dll"/>
-      <include name="${lib.dir}/all/nunit/nunit.framework.dll"/>
+      <include name="${nant.local.repo}/${nunit.dll}"/>
   	</assemblyfileset>  
   </target>
 



Mime
View raw message