Commits

tbrugz  committed 750c69b

build: better ivy config

  • Participants
  • Parent commits 8eeba23

Comments (0)

Files changed (2)

 		</schemavalidate>
 	</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>
 
 	<!-- see http://theholyjava.wordpress.com/2011/01/26/using-ivy-with-pom-xml/ -->
 	<target name="publish" depends="dist,config-ivy" description="publish this project in the ivy repository">
 		<property name="revision" value="${version}"/>
+		<property name="resolver.publish" value="local"/>
 		<ivy:info/>
-		<property name="ivy.pom.version" value="${version}"/>
-		<!--ivy:makepom ivyfile="ivy.xml" pomfile="dist/kmlutils-${version}.pom"/-->
-		<ivy:makepom ivyfile="ivy.xml" pomfile="dist/kmlutils.pom"/>
+		<property name="ivy.pom.version" value="${revision}"/>
+		<ivy:makepom ivyfile="ivy.xml" pomfile="dist/${ivy.module}.pom"/>
 		<echo message="ivy.settings.dir: ${ivy.settings.dir} ; ivy.module: ${ivy.module}"/>
-		<ivy:publish resolver="local" pubrevision="${revision}" status="release" update="true" overwrite="true">
+		<ivy:publish resolver="${resolver.publish}" pubrevision="${revision}" status="release" update="true" overwrite="true">
 			<artifacts pattern="dist/[module].[ext]" />
-			<!--artifacts pattern="dist/[artifact].[type]" /-->
-			<!--artifact name="kmlutils" ext="pom" type="pom" /-->
 			<artifact name="${ivy.module}" ext="pom" type="pom" />
 		</ivy:publish>
-		<echo message="project ${ant.project.name} released with version ${revision}"/>
+		<echo message="project ${ant.project.name} released with version ${revision} to ${resolver.publish}"/>
 	</target>
 
 </project>

File ivysettings.template.properties

+
+# set 'ivy.settings.dir' or 'ivy.settings.file'
 ivy.settings.dir=/home/tbrugz/proj/sqldump
-local.repository.dir=/home/tbrugz/proj/ivy-repo
+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