update doc with more detail on building c#

This commit is contained in:
parrt 2016-12-15 12:44:44 -08:00
parent 586b36fe94
commit 7f95781321
2 changed files with 53 additions and 9 deletions

View File

@ -233,21 +233,65 @@ popd
**Getting ready to run Nuget**
Of course you need Mono to be installed.
You then need to download nuget.exe from here: https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
From the Terminal, you can check all is ok by typing: mono <path-to-nuget.exe>. This should display the nuget help.
Of course you need Mono to be installed and also `nuget`. On mac:
```bash
brew install nuget
```
Or, you can [download nuget.exe](https://dist.nuget.org/win-x86-commandline/latest/nuget.exe).
From the shell on mac, you can check all is ok by typing
```bash
nuget
```
On linux it's likely:
```bash
mono <path-to-nuget.exe>
```
This should display the nuget help.
**Creating the assembly**
Navigate to the runtime/CSharp/Antlr4.Runtime directory.
Type: mono xbuild /p:Configuration=Release Antlr4.Runtime.mono.csproj
```bash
$ cd runtime/CSharp/runtime/CSharp/Antlr4.Runtime
$ xbuild /p:Configuration=Release Antlr4.Runtime.mono.csproj
...
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".
```
(Or `mono xbuild ...`)
Alternately, you may want to build ANTLR using Xamarin Studio Community (free).
**Packaging for NuGet**
Navigate to the runtime/CSharp solution root, where the Package.nuspec file resides.
Type the following command: mono <path-to-nuget.exe> pack Package.nuspec.
This shoud display: Successfully created package <package-path>
```bash
cd runtime/CSharp/runtime/CSharp
```
which is where the `Package.nuspec` file resides.
Type the following command:
```bash
$ nuget pack Package.nuspec
Attempting to build package from 'Package.nuspec'.
Successfully created package '/Users/parrt/antlr/code/antlr4/runtime/CSharp/runtime/CSharp/Antlr4.Runtime.Standard.4.6.0.nupkg'.
```
or
```bash
mono <path-to-nuget.exe> pack Package.nuspec
```
This should display: Successfully created package *&lt;package-path>*
**Publishing to NuGet**

View File

@ -19,6 +19,6 @@
<dependencies />
</metadata>
<files>
<file src="Antlr4.Runtime/lib/Release/Antlr4.Runtime.dll" target="lib/net35/"/>
<file src="Antlr4.Runtime/lib/Release/Antlr4.Runtime.Standard.dll" target="lib/net35/"/>
</files>
</package>