Updated build script
This commit is contained in:
parent
dfbf806c4d
commit
d23042d0a1
|
@ -1,6 +1,7 @@
|
|||
# ignore Visual Studio user files
|
||||
*.suo
|
||||
*.csproj.user
|
||||
*.sln.cache
|
||||
|
||||
# ignore C# build directories
|
||||
[Dd]ebug/
|
||||
|
@ -11,3 +12,6 @@ reference/antlr4.net/
|
|||
|
||||
# ignore Java (Maven) build directory
|
||||
tool/target/
|
||||
|
||||
# ignore NuGet output folders
|
||||
/build/nuget/
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<projectUrl>https://github.com/sharwell/antlr4cs</projectUrl>
|
||||
<licenseUrl>https://raw.github.com/sharwell/antlr4cs/master/LICENSE.txt</licenseUrl>
|
||||
<iconUrl>https://raw.github.com/antlr/website-antlr4/master/images/icons/antlr.png</iconUrl>
|
||||
<copyright>Copyright © Sam Harwell 2013</copyright>
|
||||
<copyright>Copyright © Sam Harwell 2014</copyright>
|
||||
<releaseNotes>https://github.com/sharwell/antlr4cs/releases/v$version$</releaseNotes>
|
||||
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
||||
<tags>antlr antlr4 parsing</tags>
|
||||
|
@ -51,5 +51,6 @@
|
|||
<!-- Source Code -->
|
||||
|
||||
<file exclude="..\runtime\CSharp\Antlr4.Runtime\obj\**\*.cs" src="..\runtime\CSharp\Antlr4.Runtime\**\*.cs" target="src"/>
|
||||
<file src="..\runtime\CSharp\Antlr4.Runtime\**\$Configuration$\*Lexer.cs" target="src"/>
|
||||
</files>
|
||||
</package>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<projectUrl>https://github.com/sharwell/antlr4cs</projectUrl>
|
||||
<licenseUrl>https://raw.github.com/sharwell/antlr4cs/master/LICENSE.txt</licenseUrl>
|
||||
<iconUrl>https://raw.github.com/antlr/website-antlr4/master/images/icons/antlr.png</iconUrl>
|
||||
<copyright>Copyright © Sam Harwell 2013</copyright>
|
||||
<copyright>Copyright © Sam Harwell 2014</copyright>
|
||||
<releaseNotes>https://github.com/sharwell/antlr4cs/releases/v$version$</releaseNotes>
|
||||
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
||||
<tags>antlr antlr4 parsing</tags>
|
||||
|
@ -23,7 +23,7 @@
|
|||
<files>
|
||||
<!-- Tools -->
|
||||
|
||||
<file src="$M2_REPO$\com\tunnelvisionlabs\antlr4-csharp\4.2-SNAPSHOT\antlr4-csharp-4.2-SNAPSHOT-complete.jar" target="tools"/>
|
||||
<file src="..\tool\target\antlr4-csharp-$CSharpToolVersion$-complete.jar" target="tools"/>
|
||||
|
||||
<!-- Build Configuration -->
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<projectUrl>https://github.com/sharwell/antlr4cs</projectUrl>
|
||||
<licenseUrl>https://raw.github.com/sharwell/antlr4cs/master/LICENSE.txt</licenseUrl>
|
||||
<iconUrl>https://raw.github.com/antlr/website-antlr4/master/images/icons/antlr.png</iconUrl>
|
||||
<copyright>Copyright © Sam Harwell 2013</copyright>
|
||||
<copyright>Copyright © Sam Harwell 2014</copyright>
|
||||
<releaseNotes>https://github.com/sharwell/antlr4cs/releases/v$version$</releaseNotes>
|
||||
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
||||
<tags>antlr antlr4 parsing</tags>
|
||||
|
@ -23,7 +23,7 @@
|
|||
<files>
|
||||
<!-- Tools -->
|
||||
|
||||
<file src="$M2_REPO$\com\tunnelvisionlabs\antlr4-csharp\4.2-SNAPSHOT\antlr4-csharp-4.2-SNAPSHOT-complete.jar" target="tools"/>
|
||||
<file src="..\tool\target\antlr4-csharp-$CSharpToolVersion$-complete.jar" target="tools"/>
|
||||
|
||||
<!-- Build Configuration -->
|
||||
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
# build the solutions
|
||||
$SolutionPath = "..\Runtime\CSharp\Antlr4.sln"
|
||||
$CF35SolutionPath = "..\Runtime\CSharp\Antlr4.VS2008.sln"
|
||||
|
||||
# make sure the script was run from the expected path
|
||||
if (!(Test-Path $SolutionPath)) {
|
||||
echo "The script was run from an invalid working directory."
|
||||
exit 1
|
||||
}
|
||||
|
||||
$BuildConfig = "Release"
|
||||
$DebugBuild = false
|
||||
$AntlrVersion = "4.2.0-alpha001"
|
||||
# this is configured here for path checking, but also in the .props and .targets files
|
||||
[xml]$pom = Get-Content "..\tool\pom.xml"
|
||||
$CSharpToolVersionNodeInfo = Select-Xml "/mvn:project/mvn:version" -Namespace @{mvn='http://maven.apache.org/POM/4.0.0'} $pom
|
||||
$CSharpToolVersion = $CSharpToolVersionNodeInfo.Node.InnerText.trim()
|
||||
|
||||
# build the main project
|
||||
$msbuild = "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe"
|
||||
|
||||
&$msbuild /nologo /m /nr:false /t:rebuild /p:Configuration=$BuildConfig $SolutionPath
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
echo "Build failed, aborting!"
|
||||
exit $p.ExitCode
|
||||
}
|
||||
|
||||
# build the compact framework project
|
||||
$msbuild = "C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe"
|
||||
|
||||
&$msbuild /nologo /m /nr:false /t:rebuild /p:Configuration=$BuildConfig $CF35SolutionPath
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
echo ".NET 3.5 Compact Framework Build failed, aborting!"
|
||||
exit $p.ExitCode
|
||||
}
|
||||
|
||||
if (-not (Test-Path nuget)) {
|
||||
mkdir "nuget"
|
||||
}
|
||||
|
||||
# TODO: Build the Java library using Maven
|
||||
|
||||
$JarPath = "..\tool\target\antlr4-csharp-$CSharpToolVersion-complete.jar"
|
||||
if (!(Test-Path $JarPath)) {
|
||||
echo "Couldn't locate the complete jar used for building C# parsers: $JarPath"
|
||||
exit 1
|
||||
}
|
||||
|
||||
..\runtime\CSharp\.nuget\NuGet.exe pack .\Antlr4.Runtime.nuspec -OutputDirectory nuget -Prop Configuration=$BuildConfig -Version $AntlrVersion -Prop M2_REPO=$M2_REPO -Prop CSharpToolVersion=$CSharpToolVersion -Symbols
|
||||
..\runtime\CSharp\.nuget\NuGet.exe pack .\Antlr4.nuspec -OutputDirectory nuget -Prop Configuration=$BuildConfig -Version $AntlrVersion -Prop M2_REPO=$M2_REPO -Prop CSharpToolVersion=$CSharpToolVersion -Symbols
|
||||
..\runtime\CSharp\.nuget\NuGet.exe pack .\Antlr4.VS2008.nuspec -OutputDirectory nuget -Prop Configuration=$BuildConfig -Version $AntlrVersion -Prop M2_REPO=$M2_REPO -Prop CSharpToolVersion=$CSharpToolVersion -Symbols
|
Loading…
Reference in New Issue