-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Publish NuGet package for ChorusMergeModule.msm Addresses #299
- Loading branch information
Showing
7 changed files
with
231 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build;Pack"> | ||
<PropertyGroup> | ||
<RootDir Condition="'$(teamcity_build_checkoutDir)' == '' And '$(RootDir)'==''">$(MSBuildProjectDirectory)/..</RootDir> | ||
<RootDir Condition="'$(teamcity_build_checkoutDir)' != ''">$(teamcity_build_checkoutDir)</RootDir> | ||
<Solution>Chorus.sln</Solution> | ||
<SolutionPath>$(RootDir)/$(Solution)</SolutionPath> | ||
<ApplicationName Condition="'$(OS)'=='Windows_NT'">ChorusLibrary</ApplicationName> | ||
<ApplicationName Condition="'$(OS)'!='Windows_NT'">Chorus</ApplicationName> | ||
<ApplicationNameLC>chorus</ApplicationNameLC> | ||
<Configuration Condition="'$(Configuration)'==''">Release</Configuration> | ||
<ExtraExcludeCategories Condition="'$(OS)'!='Windows_NT'">KnownMonoIssue,</ExtraExcludeCategories> | ||
<ExtraExcludeCategories Condition="'$(teamcity_version)' != ''">SkipOnTeamCity,SkipOnBuildServer,SkipOnTeamCityRandomTestFailure,$(ExtraExcludeCategories)</ExtraExcludeCategories> | ||
<useNUnit-x86 Condition="'$(OS)'=='Windows_NT'">true</useNUnit-x86> | ||
<useNUnit-x86 Condition="'$(OS)'!='Windows_NT'">false</useNUnit-x86> | ||
<OutputDir>$(RootDir)/output/$(Configuration)</OutputDir> | ||
<TeamCity Condition="'$(teamcity_version)' != ''">true</TeamCity> | ||
<TeamCity Condition="'$(teamcity_version)' == ''">false</TeamCity> | ||
|
||
<RestartBuild Condition="!Exists('$(RootDir)/packages/SIL.BuildTasks/tools/SIL.BuildTasks.dll') Or !Exists('$(RootDir)/packages/NUnit.ConsoleRunner/tools/nunit3-console.exe') Or !Exists('$(RootDir)/packages/BuildDependencyTasks/BuildDependencyTasks.dll')">true</RestartBuild> | ||
<RestartBuild Condition="Exists('$(RootDir)/packages/SIL.BuildTasks/tools/SIL.BuildTasks.dll') And Exists('$(RootDir)/packages/NUnit.ConsoleRunner/tools/nunit3-console.exe') And Exists('$(RootDir)/packages/BuildDependencyTasks/BuildDependencyTasks.dll')">false</RestartBuild> | ||
</PropertyGroup> | ||
|
||
<Import Project="NuGet.targets"/> | ||
|
||
<Target Name="RestoreBuildTasks" DependsOnTargets="CheckPrerequisites"> | ||
<Message Text="RestartBuild=$(RestartBuild)" /> | ||
<Exec Command='$(NuGetCommand) install NUnit.Console -excludeVersion -version 3.11.1 -solutionDirectory "$(RootDir)"' /> | ||
<Exec Command='$(NuGetCommand) install SIL.BuildTasks -excludeVersion -version 2.3.2 -solutionDirectory "$(RootDir)"' /> | ||
<Exec Command='$(NuGetCommand) install BuildDependencyTasks -excludeVersion -version 0.4.3 -solutionDirectory "$(RootDir)"' /> | ||
</Target> | ||
|
||
<UsingTask TaskName="MakeWixForDirTree" AssemblyFile="$(RootDir)/packages/SIL.BuildTasks/tools/SIL.BuildTasks.dll" | ||
Condition="'$(OS)'=='Windows_NT' And Exists('$(RootDir)/packages/SIL.BuildTasks/tools/SIL.BuildTasks.dll')"/> | ||
<UsingTask TaskName="Archive" AssemblyFile="$(RootDir)/packages/SIL.BuildTasks/tools/SIL.BuildTasks.dll" | ||
Condition="'$(OS)'!='Windows_NT' And Exists('$(RootDir)/packages/SIL.BuildTasks/tools/SIL.BuildTasks.dll')"/> | ||
<UsingTask TaskName="FileUpdate" AssemblyFile="$(RootDir)/packages/SIL.BuildTasks/tools/SIL.BuildTasks.dll" Condition="Exists('$(RootDir)/packages/SIL.BuildTasks/tools/SIL.BuildTasks.dll')"/> | ||
<UsingTask TaskName="NUnit3" AssemblyFile="$(RootDir)/packages/SIL.BuildTasks/tools/SIL.BuildTasks.dll" Condition="Exists('$(RootDir)/packages/SIL.BuildTasks/tools/SIL.BuildTasks.dll')"/> | ||
<UsingTask TaskName="Dependencies" AssemblyFile="$(SolutionDir)/packages/BuildDependencyTasks/BuildDependencyTasks.dll" Condition="Exists('$(RootDir)/packages/BuildDependencyTasks/BuildDependencyTasks.dll')"/> | ||
|
||
<!-- Windows installer stuff --> | ||
<Target Name="Installer" DependsOnTargets="CleanInstaller; Build" Condition="'$(OS)'=='Windows_NT'"> | ||
|
||
<!-- set the version number in the installer configuration program. Perhaps there's a way to just send in the variables rather than this brute-force | ||
changing of the script, but I haven't figured that out. --> | ||
|
||
<FileUpdate File="$(RootDir)\src\Installer\ChorusMergeModule.wxs" Regex='Property_ProductVersion = ".*"' | ||
ReplacementText ="Property_ProductVersion = "$(GitVersion_AssemblySemFileVer)"" /> | ||
<Message Text="Making Chorus Merge Module Version: $(GitVersion_AssemblySemFileVer)" Importance="high" /> | ||
|
||
<MSBuild Projects="$(RootDir)\src\Installer\ChorusMergeModule.wixproj"/> | ||
|
||
</Target> | ||
|
||
<Target Name="ChorusHubInstaller" DependsOnTargets="CleanInstaller;Build" Condition="'$(OS)'=='Windows_NT'"> | ||
|
||
<!-- set the version number in the installer configuration program. Perhaps there's a way to just send in the variables rather than this brute-force | ||
changing of the script, but I haven't figured that out. --> | ||
|
||
<FileUpdate File="$(RootDir)\src\Installer\ChorusHub.wxs" Regex='Property_ProductVersion = ".*"' | ||
ReplacementText="Property_ProductVersion = "$(GitVersion_AssemblySemFileVer)"" /> | ||
<FileUpdate File="$(RootDir)\src\Installer\resources\License.rtf" RegEx='COPYRIGHTYEARPLACEHOLDER' | ||
ReplacementText="$([System.DateTime]::Now.ToString(yyyy))" /> | ||
<Message Text="Making Chorus Hub installer with version: $(GitVersion_AssemblySemFileVer)" Importance="high" /> | ||
|
||
<MSBuild Projects="$(RootDir)\src\Installer\ChorusHub.wixproj"/> | ||
|
||
</Target> | ||
|
||
<Target Name="SignChorusHub" DependsOnTargets="ChorusHubInstaller"> | ||
<Message Text="Attempting to sign ChorusHubInstaller.msi" Importance="high" /> | ||
<Exec Command='sign "$(RootDir)\output\Release\ChorusHubInstaller.msi" ' /> | ||
</Target> | ||
|
||
<Target Name="MakeWixForDistFiles" DependsOnTargets="Compile" Condition="'$(OS)'=='Windows_NT'"> | ||
<!-- NB: The Exclude argument doesn't seem to be working so you may need to hand edit the GeneratedMercurial.wxs --> | ||
<MakeWixForDirTree | ||
DirectoryReferenceId="mercurial" | ||
ComponentGroupId="Mercurial" | ||
RootDirectory="$(RootDir)\mercurial" | ||
OutputFilePath="$(RootDir)\src\Installer\GeneratedMercurial.wxs" | ||
IgnoreRegExPattern="IGNOREME|\.gitignore" | ||
Exclude="$(RootDir)\mercurial\mercurial.ini;$(RootDir)\mercurial\default.d\cacerts.rc" | ||
MatchRegExPattern=".*"> | ||
<Output TaskParameter="OutputFilePath" ItemName="Compile" /> | ||
</MakeWixForDirTree> | ||
<MakeWixForDirTree | ||
DirectoryReferenceId="MercurialExtensions" | ||
ComponentGroupId="MercurialExtensions" | ||
RootDirectory="$(RootDir)\MercurialExtensions" | ||
OutputFilePath="$(RootDir)\src\Installer\GeneratedMercurialExtensions.wxs" | ||
IgnoreRegExPattern="IGNOREME|\.gitignore" | ||
MatchRegExPattern=".*"> | ||
<Output TaskParameter="OutputFilePath" ItemName="Compile" /> | ||
</MakeWixForDirTree> | ||
</Target> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> | ||
<metadata> | ||
<id>$PackageId$</id> | ||
<version>$Version$</version> | ||
<description>This is a merge module to set up https://github.com/sillsdev/chorus</description> | ||
<authors>SIL International</authors> | ||
<license type="expression">MIT</license> | ||
<projectUrl>https://github.com/sillsdev/chorus</projectUrl> | ||
<copyright>Copyright © 2010-$Year$ SIL International</copyright> | ||
</metadata> | ||
<files> | ||
<file src="../../output/Release/ChorusMergeModule.msm" target="content"/> | ||
</files> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<NuGetToolsPath>$(MSBuildThisFileDirectory)</NuGetToolsPath> | ||
|
||
<!-- NuGet command --> | ||
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)nuget.exe</NuGetExePath> | ||
|
||
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand> | ||
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono $(NuGetExePath)</NuGetCommand> | ||
<NuGetDownloadUrl>https://dist.nuget.org/win-x86-commandline/latest/nuget.exe</NuGetDownloadUrl> | ||
</PropertyGroup> | ||
|
||
<Target Name="CheckPrerequisites"> | ||
<!-- | ||
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once. | ||
This effectively acts as a lock that makes sure that the download operation will only happen once and all | ||
parallel builds will have to wait for it to complete. | ||
--> | ||
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" | ||
Properties="Configuration=NOT_IMPORTANT" /> | ||
</Target> | ||
|
||
<Target Name="_DownloadNuGet" Condition="!Exists('$(NuGetExePath)')"> | ||
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition="'$(OS)' == 'Windows_NT'" /> | ||
<Exec Command="wget $(NuGetDownloadUrl) || curl -O -L $(NuGetDownloadUrl)" | ||
WorkingDirectory="$(NuGetToolsPath)" | ||
Condition="'$(OS)' != 'Windows_NT'" /> | ||
</Target> | ||
|
||
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" | ||
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" | ||
Condition=" '$(OS)' == 'Windows_NT' "> | ||
<ParameterGroup> | ||
<OutputFilename ParameterType="System.String" Required="true" /> | ||
</ParameterGroup> | ||
<Task> | ||
<Reference Include="System.Core" /> | ||
<Using Namespace="System" /> | ||
<Using Namespace="System.IO" /> | ||
<Using Namespace="System.Net" /> | ||
<Using Namespace="Microsoft.Build.Framework" /> | ||
<Using Namespace="Microsoft.Build.Utilities" /> | ||
<Code Type="Fragment" Language="cs"> | ||
<![CDATA[ | ||
try { | ||
OutputFilename = Path.GetFullPath(OutputFilename); | ||
Log.LogMessage("Downloading latest version of nuget.exe..."); | ||
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12; | ||
WebClient webClient = new WebClient(); | ||
webClient.DownloadFile("$(NuGetDownloadUrl)", OutputFilename); | ||
return true; | ||
} | ||
catch (Exception ex) { | ||
Log.LogErrorFromException(ex); | ||
return false; | ||
} | ||
]]> | ||
</Code> | ||
</Task> | ||
</UsingTask> | ||
</Project> |