Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contributors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,4 @@ YYYY/MM/DD, github id, Full name, email
2017/03/28, cmd-johnson, Jonas Auer, [email protected]
2017/04/12, lys0716, Yishuang Lu, [email protected]
2017/05/11, jimallman, Jim Allman, [email protected]
2017/05/26, waf, Will Fuqua, [email protected]
42 changes: 13 additions & 29 deletions doc/releasing-antlr.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,13 @@ popd

*Publishing to Nuget from Linux/MacOSX*

**Getting ready to run Nuget**
**Install the pre-requisites**

Of course you need Mono and `nuget` to be installed. On mac:

```bash
brew install mono
brew install nuget
```

Or, you can [download nuget.exe](https://dist.nuget.org/win-x86-commandline/latest/nuget.exe).
- mono - on mac, `brew install mono`
- nuget - on mac, `brew install nuget` or you can [download nuget.exe](https://dist.nuget.org/win-x86-commandline/latest/nuget.exe)
- dotnet - follow [the instructions here](https://www.microsoft.com/net/core)

From the shell on mac, you can check all is ok by typing

Expand All @@ -266,36 +263,23 @@ nuget

This should display the nuget help.

**Creating the assembly**
**Creating and packaging the assembly**

```bash
$ cd runtime/CSharp/runtime/CSharp/Antlr4.Runtime
$ xbuild /p:Configuration=Release Antlr4.Runtime.mono.csproj
$ cd runtime/CSharp/runtime/CSharp
$ ./build-nuget-package.sh
...
Copying file from '/Users/parrt/antlr/code/antlr4/runtime/CSharp/runtime/CSharp/Antlr4.Runtime/obj/net20/Release/Antlr4.Runtime.Standard.dll' to '/Users/parrt/antlr/code/antlr4/runtime/CSharp/runtime/CSharp/Antlr4.Runtime/lib/Release/Antlr4.Runtime.Standard.dll'
Done building project "/Users/parrt/antlr/code/antlr4/runtime/CSharp/runtime/CSharp/Antlr4.Runtime/Antlr4.Runtime.mono.csproj".
```

Alternately, you may want to build ANTLR using Xamarin Studio Community (free).

**Packaging for NuGet**

```bash
cd runtime/CSharp/runtime/CSharp
```

which is where the `Package.nuspec` file resides.

Type the following command:

```bash
$ nuget pack Package.nuspec
Build succeeded.
0 Warning(s)
0 Error(s)
Attempting to build package from 'Package.nuspec'.
Successfully created package '/Users/parrt/antlr/code/antlr4/runtime/CSharp/runtime/CSharp/Antlr4.Runtime.Standard.4.7.0.nupkg'.
Successfully created package '/path/to/antlr/.../Antlr4.Runtime.Standard.4.7.0.nupkg'.
```

This should display: Successfully created package *<package-path>*

Alternately, you may want to build ANTLR using Xamarin Studio Community (free).

**Publishing to NuGet**

You need to be a NuGet owner for "ANTLR 4 Standard Runtime"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,15 @@
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>lib\Debug</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>lib\Release</OutputPath>
</PropertyGroup>

</Project>
1 change: 1 addition & 0 deletions runtime/CSharp/runtime/CSharp/Package.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
</metadata>
<files>
<file src="Antlr4.Runtime/lib/Release/Antlr4.Runtime.Standard.dll" target="lib/net35/"/>
<file src="Antlr4.Runtime/lib/Release/netstandard1.3/Antlr4.Runtime.Core.dll" target="lib/netstandard/"/>
</files>
</package>
14 changes: 14 additions & 0 deletions runtime/CSharp/runtime/CSharp/build-nuget-package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

# Build a .NET 3.5 compatible DLL using mono
# This step can be done by the `dotnet` cli once https://github.com/Microsoft/msbuild/issues/1333 is resolved.
echo "Step 1: Building .NET 3.5 DLL"
xbuild /p:Configuration=Release Antlr4.mono.sln

# Build a .NET core DLL using the `dotnet` cli from microsoft
echo "Step 2: Building .NET Core DLL"
dotnet restore Antlr4.dotnet.sln
dotnet build -c Release Antlr4.dotnet.sln

echo "Step 3: Packaging both DLLs into a single nuget package"
nuget pack Package.nuspec