Commits

tbrugz committed 045c7c7

build: ivy: added makepom & better publish/config

Comments (0)

Files changed (2)

 	<target name="resolve-base" depends="resolve-mondrianschema2graphml">
 	</target-->
 
-	<target name="config-ivy" if="ivy.settings.dir">
+	<target name="config-ivy-file" if="ivy.settings.file">
+		<echo message="setting ivy file: ${ivy.settings.file}"/>
+		<ivy:settings file="${ivy.settings.file}"/>
+	</target>
+	
+	<target name="config-ivy-dir" if="ivy.settings.dir" unless="ivy.settings.file">
+		<echo message="setting ivy file (by dir): ${ivy.settings.dir}/ivysettings.xml"/>
 		<ivy:settings file="${ivy.settings.dir}/ivysettings.xml"/>
-	</target>	
+	</target>
 
+	<target name="config-ivy" depends="config-ivy-file,config-ivy-dir"/>
+	
 	<target name="resolve-ivy" depends="config-ivy" description="retrieve dependencies with ivy">
 		<ivy:retrieve />
-	</target>	
+	</target>
 
 	<!--target name="resolve-get" description="retrieve dependencies with 'get'" depends="resolve-base">
 		<get dest="${lib.dir}">
 	
 	<target name="publish" depends="jar,config-ivy" description="publish this project in the ivy repository">
 		<property name="revision" value="${version}"/>
-		<property name="resolver" value="local"/>
-		<ivy:info file="ivy.xml"/>
-		<echo message="revision = ${revision} ; ivy.deliver.ivy.pattern = ${ivy.deliver.ivy.pattern}"/>
-		<ivy:publish resolver="${resolver}" pubrevision="${revision}" status="release" update="true" overwrite="true">
-			<!--artifacts pattern="${dist.dir}/[organisation]-[module].[ext]" /-->
+		<property name="resolver.publish" value="local"/>
+		<ivy:info/>
+		<echo message="revision = ${revision}"/>
+		<property name="ivy.pom.version" value="${revision}"/>
+		<ivy:makepom ivyfile="ivy.xml" pomfile="dist/${ivy.module}.pom"/>
+		<ivy:publish resolver="${resolver.publish}" pubrevision="${revision}" status="release" update="true" overwrite="true">
 			<artifacts pattern="${dist.dir}/[module].[ext]" />
+			<artifact name="${ivy.module}" ext="pom" type="pom" />
 		</ivy:publish>
-		<echo message="project ${ant.project.name} released with version ${revision} to ${resolver}"/>
+		<echo message="project ${ant.project.name} released with version ${revision} to ${resolver.publish}"/>
 	</target>
 
 	<!-- ========= /dependencies tasks ========== -->

ivysettings.template.properties

-local.repository.dir=/home/tbrugz/proj/ivy-repo
-ivy.settings.dir=..
-resolver=local
+
+# set 'ivy.settings.dir' or 'ivy.settings.file'
+ivy.settings.dir=/home/tbrugz/proj/sqldump
+ivy.settings.file=/home/tbrugz/proj/queryon/ivysettings.xml
+
+# resolver name & properties to be used by resolver
+resolver.publish=local-mvn-publish
+mvn.repository.dir=/home/tbrugz/proj/mvn-repo
+#mvn.repository.dir=d:/proj/mvn-repo
+#local.repository.dir=/home/tbrugz/proj/ivy-repo