From: <fab...@us...> - 2011-03-14 20:21:37
|
Revision: 5473 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5473&view=rev Author: fabiomaulo Date: 2011-03-14 20:21:30 +0000 (Mon, 14 Mar 2011) Log Message: ----------- Refactoring nuget scripts Modified Paths: -------------- trunk/nhibernate/build-common/common.xml trunk/nhibernate/default.build trunk/nhibernate/src/Iesi.Collections/Iesi.Collections.build trunk/nhibernate/src/Iesi.Collections/Iesi.Collections.nuspec.template trunk/nhibernate/src/NHibernate/NHibernate.build trunk/nhibernate/src/NHibernate/NHibernate.nuspec.template trunk/nhibernate/src/NHibernate.ByteCode.Castle/ByteCode.build trunk/nhibernate/src/NHibernate.ByteCode.Castle/NHibernate.Castle.nuspec.template trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ByteCode.build trunk/nhibernate/src/NHibernate.ByteCode.LinFu/NHibernate.LinFu.nuspec.template trunk/nhibernate/src/NHibernate.ByteCode.Spring/ByteCode.build trunk/nhibernate/src/NHibernate.ByteCode.Spring/NHibernate.Spring.nuspec.template Modified: trunk/nhibernate/build-common/common.xml =================================================================== --- trunk/nhibernate/build-common/common.xml 2011-03-14 04:16:20 UTC (rev 5472) +++ trunk/nhibernate/build-common/common.xml 2011-03-14 20:21:30 UTC (rev 5473) @@ -255,4 +255,15 @@ <target name="common.find-ndoc"> <property name="ndoc-console" value="${tools.dir}/ndoc/NDocConsole.exe" /> </target> + + <target name="nuget.set-properties"> + <property name="nuget.nupackages.relative-dir" value="nuget_gallery" /> + <!-- The nuget.workingdir is the directory from where all *.nuspec files will work. + This is to simplify the compilation of *.nuspec.template files (see section 'files')--> + <property name="nuget.workingdir" value="${build.dir}/tmp_nugetdeploy" /> + + <property name="nuget.nupackages.dir" value="${build.dir}/${nuget.nupackages.relative-dir}" /> + <property name="nuget.nupackages.pushbatfile" value="${nuget.nupackages.dir}/NuGetPush.bat" /> + </target> + </project> Modified: trunk/nhibernate/default.build =================================================================== --- trunk/nhibernate/default.build 2011-03-14 04:16:20 UTC (rev 5472) +++ trunk/nhibernate/default.build 2011-03-14 20:21:30 UTC (rev 5473) @@ -386,48 +386,62 @@ <include name="NHibernate.ByteCode.Spring/ByteCode.build" /> </fileset> - <target name="nuspec" depends="init" description="Create nuspec files"> + <target name="nuspec" depends="init nuget.set-properties" description="Create nuspec files"> <nant target="nuspec"> <buildfiles refid="nugetfiles.all" /> </nant> </target> - <target name="nuget" depends="init binaries nuspec" + <target name="nuget" depends="init binaries nuget.set-properties nuspec" description="Creates files for the release on nuget gallery."> - - <property name="nuget.conf-template" value="${build.dir}/NHibernateXmlConfigurationTemplates" /> - <copy file="releasenotes.txt" tofile="${build.dir}/NHibernate.releasenotes.txt"/> - <copy file="readme.html" tofile="${build.dir}/NHibernate.readme.html"/> - <copy file="lgpl.txt" tofile="${build.dir}/NHibernate.license.txt"/> - <!--Configuration templates--> - <copy todir="${nuget.conf-template}"> - <fileset basedir="src/NHibernate.Config.Templates"> - <include name="*"/> - </fileset> - </copy> - - <property name="nugetdeploy.subdir" value="nuget_gallery" /> - <mkdir dir="${build.dir}/${nugetdeploy.subdir}" /> - + <nant target="nuget"> <buildfiles refid="nugetfiles.all" /> </nant> - <!--Create NuGet push bat --> - <copy file="${tools.dir}/NuGet.exe" todir="${build.dir}/${nugetdeploy.subdir}"/> - <property name="nugetdeploy.pushbatfile" value="${build.dir}/${nugetdeploy.subdir}/NuGetPush.bat" /> + <mkdir dir="${nuget.nupackages.dir}" /> + <move todir="${nuget.nupackages.dir}"> + <fileset basedir="${nuget.workingdir}"> + <include name="*.nupkg" /> + </fileset> + </move> + </target> + + <target name="nugetpushbat" depends="init binaries nuget.set-properties nuspec nuget" + description="Creates files for the release on nuget gallery."> - <echo message="rem The parameter is your NuGet access key ${environment::newline()}" file="${nugetdeploy.pushbatfile}" append="false"/> + <copy file="${tools.dir}/NuGet.exe" todir="${nuget.nupackages.dir}"/> + + <echo message="rem In order to use this bat you have to be sure you have executed 'nuget SetApiKey' ${environment::newline()}" file="${nuget.nupackages.pushbatfile}" append="false"/> <foreach item="File" property="filename"> <in> <items> - <include name="${build.dir}/${nugetdeploy.subdir}/*.nupkg"/> + <include name="${nuget.nupackages.dir}/*.nupkg"/> </items> </in> <do> - <echo message="nuget push -source http://packages.nuget.org/v1/ ${filename} %1 ${environment::newline()}" file="${nugetdeploy.pushbatfile}" append="true"/> + <echo message="nuget push -source http://packages.nuget.org/v1/ ${filename} ${environment::newline()}" file="${nuget.nupackages.pushbatfile}" append="true"/> </do> </foreach> </target> + + <target name="nugetpush" depends="init binaries nuget.set-properties nuspec nuget" + description="Push packages on nuget gallery."> + <!-- In order to use this task you have to be sure you have executed 'nuget SetApiKey' --> + <foreach item="File" property="filename"> + <in> + <items> + <include name="${nuget.nupackages.dir}/*.nupkg"/> + </items> + </in> + <do> + <exec basedir="${tools.dir}" workingdir="${nuget.nupackages.dir}" program="NuGet.exe"> + <arg value="push" /> + <arg line="-source http://packages.nuget.org/v1/"/> + <arg value="${filename}" /> + </exec> + </do> + </foreach> + </target> </project> Modified: trunk/nhibernate/src/Iesi.Collections/Iesi.Collections.build =================================================================== --- trunk/nhibernate/src/Iesi.Collections/Iesi.Collections.build 2011-03-14 04:16:20 UTC (rev 5472) +++ trunk/nhibernate/src/Iesi.Collections/Iesi.Collections.build 2011-03-14 20:21:30 UTC (rev 5473) @@ -35,19 +35,22 @@ <target name="generate-assemblyinfo" depends="init common.generate-assemblyinfo" /> <target name="build" depends="init generate-assemblyinfo common.compile-dll" description="Build Iesi.Collections" /> - <target name="nuspec" depends="init" description="Create nuspec for Iesi.Collections"> - <property name="nuspec.destination.file" value="${build.dir}/${nuspec.destination.filename}" /> + <target name="nuspec" depends="init nuget.set-properties" description="Create nuspec for Iesi.Collections"> + <property name="nuspec.destination.file" value="${nuget.workingdir}/${nuspec.destination.filename}" /> <copy file="Iesi.Collections.nuspec.template" tofile="${nuspec.destination.file}"/> <xmlpoke file="${nuspec.destination.file}" xpath="/package/metadata/version" value="${project.version.numeric}" /> </target> - <target name="nuget" depends="init nuspec"> - <exec basedir="${tools.dir}" workingdir="${build.dir}" program="NuGet.exe"> + <target name="nuget" depends="init nuget.set-properties nuspec"> + <!-- Prepare working dir with file needed by Iesi.Collections.nuspec --> + <copy file="${bin.dir}/Iesi.Collections.dll" todir="${nuget.workingdir}"/> + <copy file="${bin.dir}/Iesi.Collections.xml" todir="${nuget.workingdir}"/> + + <exec basedir="${tools.dir}" workingdir="${nuget.workingdir}" program="NuGet.exe"> <arg value="pack" /> <arg value="${nuspec.destination.filename}" /> - <arg line="-o ${nugetdeploy.subdir}" /> </exec> </target> Modified: trunk/nhibernate/src/Iesi.Collections/Iesi.Collections.nuspec.template =================================================================== --- trunk/nhibernate/src/Iesi.Collections/Iesi.Collections.nuspec.template 2011-03-14 04:16:20 UTC (rev 5472) +++ trunk/nhibernate/src/Iesi.Collections/Iesi.Collections.nuspec.template 2011-03-14 20:21:30 UTC (rev 5473) @@ -13,8 +13,6 @@ <tags>Collections</tags> </metadata> <files> - <file src="bin\net-3.5\Iesi.Collections.dll" target="lib\Net35" /> - <file src="bin\net-3.5\Iesi.Collections.pdb" target="lib\Net35" /> - <file src="bin\net-3.5\Iesi.Collections.license.txt" target="lib\Net35" /> + <file src="Iesi.Collections.*" target="lib\Net35" /> </files> </package> \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/NHibernate.build =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.build 2011-03-14 04:16:20 UTC (rev 5472) +++ trunk/nhibernate/src/NHibernate/NHibernate.build 2011-03-14 20:21:30 UTC (rev 5473) @@ -77,8 +77,8 @@ <copy file="${bin.dir}/NHibernate.dll" tofile="${root.dir}/${lib.framework.dir}/NHibernate.dll"/> </target> - <target name="nuspec" depends="init" description="Create nuspec for Iesi.Collections"> - <property name="nuspec.destination.file" value="${build.dir}/${nuspec.destination.filename}" /> + <target name="nuspec" depends="init nuget.set-properties" description="Create nuspec for NHibernate"> + <property name="nuspec.destination.file" value="${nuget.workingdir}/${nuspec.destination.filename}" /> <copy file="NHibernate.nuspec.template" tofile="${nuspec.destination.file}"/> <xmlpoke file="${nuspec.destination.file}" xpath="/package/metadata/dependencies/dependency[@id = 'Iesi.Collections']/@version" @@ -88,11 +88,27 @@ value="${project.version.numeric}" /> </target> - <target name="nuget" depends="init nuspec"> - <exec basedir="${tools.dir}" workingdir="${build.dir}" program="NuGet.exe"> + <target name="nuget" depends="init nuget.set-properties nuspec"> + <!-- Prepare working dir with file needed by NHibernate.nuspec --> + <copy file="${bin.dir}/NHibernate.dll" todir="${nuget.workingdir}"/> + <copy file="${bin.dir}/NHibernate.xml" todir="${nuget.workingdir}"/> + <copy file="${root.dir}/releasenotes.txt" tofile="${nuget.workingdir}/NHibernate.releasenotes.txt"/> + <copy file="${root.dir}/readme.html" tofile="${nuget.workingdir}/NHibernate.readme.html"/> + <copy file="${root.dir}/lgpl.txt" tofile="${nuget.workingdir}/NHibernate.license.txt"/> + <copy todir="${nuget.workingdir}"> + <fileset basedir="${root.dir}/src/NHibernate"> + <include name="*.xsd" /> + </fileset> + </copy> + <copy todir="${nuget.workingdir}/NHibernateXmlConfigurationTemplates"> + <fileset basedir="../NHibernate.Config.Templates"> + <include name="*"/> + </fileset> + </copy> + + <exec basedir="${tools.dir}" workingdir="${nuget.workingdir}" program="NuGet.exe"> <arg value="pack" /> <arg value="${nuspec.destination.filename}" /> - <arg line="-o ${nugetdeploy.subdir}" /> </exec> </target> Modified: trunk/nhibernate/src/NHibernate/NHibernate.nuspec.template =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.nuspec.template 2011-03-14 04:16:20 UTC (rev 5472) +++ trunk/nhibernate/src/NHibernate/NHibernate.nuspec.template 2011-03-14 20:21:30 UTC (rev 5473) @@ -4,21 +4,24 @@ <id>NHibernate</id> <version>x.y.z</version> <authors>NHibernate community, Hibernate community</authors> - <summary>NHibernate is a mature, open source object-relational mapper for the .NET framework.</summary> + <summary>DONT INSTALL IT DIRECTLY. Use only as reference for others frameworks.</summary> <description> DONT INSTALL IT DIRECTLY Only as reference for others frameworks. + see NHibernate.Castle, NHibernate.LinFu, NHibernate.Spring. NHibernate is a mature, open source object-relational mapper for the .NET framework. It's actively developed , fully featured and used in thousands of successful projects. </description> <language>en-US</language> - <tags>ORM, DataBase, DAL, Object Relational Mapping</tags> + <tags>ORM, DataBase, DAL, ObjectRelationalMapping</tags> <dependencies> <dependency id="Iesi.Collections" version="x.y.z" /> </dependencies> </metadata> <files> - <file src="bin\net-3.5\NHibernate.dll" target="lib\Net35" /> + <file src="NHibernate.dll" target="lib\Net35" /> + <file src="NHibernate.xml" target="lib\Net35" /> + <file src="*.xsd" target="lib\Net35" /> <file src="NHibernate.releasenotes.txt" target="lib\Net35" /> <file src="NHibernate.readme.html" target="lib\Net35" /> <file src="NHibernate.license.txt" target="lib\Net35" /> Modified: trunk/nhibernate/src/NHibernate.ByteCode.Castle/ByteCode.build =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle/ByteCode.build 2011-03-14 04:16:20 UTC (rev 5472) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle/ByteCode.build 2011-03-14 20:21:30 UTC (rev 5473) @@ -33,8 +33,8 @@ <target name="generate-assemblyinfo" depends="init common.generate-assemblyinfo" /> <target name="build" depends="init generate-assemblyinfo common.compile-dll" description="Build Castle ByteCode" /> - <target name="nuspec" depends="init" description="Create nuspec for NHibernate.ByteCode.Castle"> - <property name="nuspec.destination.file" value="${build.dir}/${nuspec.destination.filename}" /> + <target name="nuspec" depends="init nuget.set-properties" description="Create nuspec for NHibernate.ByteCode.Castle"> + <property name="nuspec.destination.file" value="${nuget.workingdir}/${nuspec.destination.filename}" /> <copy file="NHibernate.Castle.nuspec.template" tofile="${nuspec.destination.file}"/> <xmlpoke file="${nuspec.destination.file}" xpath="/package/metadata/dependencies/dependency[@id = 'NHibernate']/@version" @@ -43,11 +43,14 @@ xpath="/package/metadata/version" value="${project.version.numeric}" /> </target> - <target name="nuget" depends="init nuspec"> - <exec basedir="${tools.dir}" workingdir="${build.dir}" program="NuGet.exe"> + <target name="nuget" depends="init nuget.set-properties nuspec"> + <!-- Prepare working dir with file needed by NHibernate.Castle.nuspec --> + <copy file="${bin.dir}/NHibernate.ByteCode.Castle.dll" todir="${nuget.workingdir}"/> + <copy file="${bin.dir}/NHibernate.ByteCode.Castle.xml" todir="${nuget.workingdir}"/> + + <exec basedir="${tools.dir}" workingdir="${nuget.workingdir}" program="NuGet.exe"> <arg value="pack" /> <arg value="${nuspec.destination.filename}" /> - <arg line="-o ${nugetdeploy.subdir}" /> </exec> </target> Modified: trunk/nhibernate/src/NHibernate.ByteCode.Castle/NHibernate.Castle.nuspec.template =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Castle/NHibernate.Castle.nuspec.template 2011-03-14 04:16:20 UTC (rev 5472) +++ trunk/nhibernate/src/NHibernate.ByteCode.Castle/NHibernate.Castle.nuspec.template 2011-03-14 20:21:30 UTC (rev 5473) @@ -17,7 +17,7 @@ </dependencies> </metadata> <files> - <file src="bin\net-3.5\NHibernate.ByteCode.Castle.dll" target="lib\Net35" /> - <file src="bin\net-3.5\NHibernate.ByteCode.Castle.xml" target="lib\Net35" /> + <file src="NHibernate.ByteCode.Castle.dll" target="lib\Net35" /> + <file src="NHibernate.ByteCode.Castle.xml" target="lib\Net35" /> </files> </package> \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ByteCode.build =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ByteCode.build 2011-03-14 04:16:20 UTC (rev 5472) +++ trunk/nhibernate/src/NHibernate.ByteCode.LinFu/ByteCode.build 2011-03-14 20:21:30 UTC (rev 5473) @@ -33,8 +33,8 @@ <target name="generate-assemblyinfo" depends="init common.generate-assemblyinfo" /> <target name="build" depends="init generate-assemblyinfo common.compile-dll" description="Build LinFu ByteCode" /> - <target name="nuspec" depends="init" description="Create nuspec for NHibernate.ByteCode.LinFu"> - <property name="nuspec.destination.file" value="${build.dir}/${nuspec.destination.filename}" /> + <target name="nuspec" depends="init nuget.set-properties" description="Create nuspec for NHibernate.ByteCode.LinFu"> + <property name="nuspec.destination.file" value="${nuget.workingdir}/${nuspec.destination.filename}" /> <copy file="NHibernate.LinFu.nuspec.template" tofile="${nuspec.destination.file}"/> <xmlpoke file="${nuspec.destination.file}" xpath="/package/metadata/dependencies/dependency[@id = 'NHibernate']/@version" @@ -43,11 +43,19 @@ xpath="/package/metadata/version" value="${project.version.numeric}" /> </target> - <target name="nuget" depends="init nuspec"> - <exec basedir="${tools.dir}" workingdir="${build.dir}" program="NuGet.exe"> + <target name="nuget" depends="init nuget.set-properties nuspec"> + <!-- Prepare working dir with file needed by NHibernate.LinFu.nuspec --> + <copy file="${bin.dir}/NHibernate.ByteCode.LinFu.dll" todir="${nuget.workingdir}"/> + <copy file="${bin.dir}/NHibernate.ByteCode.LinFu.xml" todir="${nuget.workingdir}"/> + <copy todir="${nuget.workingdir}"> + <fileset basedir="${bin.dir}"> + <include name="LinFu*.*" /> + </fileset> + </copy> + + <exec basedir="${tools.dir}" workingdir="${nuget.workingdir}" program="NuGet.exe"> <arg value="pack" /> <arg value="${nuspec.destination.filename}" /> - <arg line="-o ${nugetdeploy.subdir}" /> </exec> </target> Modified: trunk/nhibernate/src/NHibernate.ByteCode.LinFu/NHibernate.LinFu.nuspec.template =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.LinFu/NHibernate.LinFu.nuspec.template 2011-03-14 04:16:20 UTC (rev 5472) +++ trunk/nhibernate/src/NHibernate.ByteCode.LinFu/NHibernate.LinFu.nuspec.template 2011-03-14 20:21:30 UTC (rev 5473) @@ -16,8 +16,8 @@ </dependencies> </metadata> <files> - <file src="bin\net-3.5\NHibernate.ByteCode.LinFu.dll" target="lib\Net35" /> - <file src="bin\net-3.5\NHibernate.ByteCode.LinFu.xml" target="lib\Net35" /> - <file src="bin\net-3.5\LinFu*.*" target="lib\Net35" /> + <file src="NHibernate.ByteCode.LinFu.dll" target="lib\Net35" /> + <file src="NHibernate.ByteCode.LinFu.xml" target="lib\Net35" /> + <file src="LinFu*.*" target="lib\Net35" /> </files> </package> \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.ByteCode.Spring/ByteCode.build =================================================================== (Binary files differ) Modified: trunk/nhibernate/src/NHibernate.ByteCode.Spring/NHibernate.Spring.nuspec.template =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Spring/NHibernate.Spring.nuspec.template 2011-03-14 04:16:20 UTC (rev 5472) +++ trunk/nhibernate/src/NHibernate.ByteCode.Spring/NHibernate.Spring.nuspec.template 2011-03-14 20:21:30 UTC (rev 5473) @@ -16,8 +16,8 @@ </dependencies> </metadata> <files> - <file src="bin\net-3.5\NHibernate.ByteCode.Spring.dll" target="lib\Net35" /> - <file src="bin\net-3.5\NHibernate.ByteCode.Spring.xml" target="lib\Net35" /> - <file src="bin\net-3.5\Spring*.*" target="lib\Net35" /> + <file src="NHibernate.ByteCode.Spring.dll" target="lib\Net35" /> + <file src="NHibernate.ByteCode.Spring.xml" target="lib\Net35" /> + <file src="Spring*.*" target="lib\Net35" /> </files> </package> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |