Unverified Commit 1cc74393 authored by Vinicius Jarina's avatar Vinicius Jarina Committed by GitHub
Browse files

* Giant cleanup/reshuffle of all files. (#265)

* * Giant cleanup/reshuffle of all files.

* * Update upstream `KeraLua` to `0.1.14`

* Fixed .NET Core build.

* Add runsettings file

* * Fixed nuspec `dependencies` node

* Ignore _ in branch names for package names.

* * Fixed nuspec.
parent 3f254585
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="NLuaTest.Android">
<uses-sdk />
<application android:label="NLuaTest.Android">
</application>
</manifest>
\ No newline at end of file
using System.Reflection;
using System.Runtime.CompilerServices;
using Android.App;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("NLuaTests.Android")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("viniciusjarina")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.0")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
Images, layout descriptions, binary blobs and string dictionaries can be included
in your application as resource files. Various Android APIs are designed to
operate on the resource IDs instead of dealing with images, strings or binary blobs
directly.
For example, a sample Android app that contains a user interface layout (main.axml),
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
would keep its resources in the "Resources" directory of the application:
Resources/
drawable/
icon.png
layout/
main.axml
values/
strings.xml
In order to get the build system to recognize Android resources, set the build action to
"AndroidResource". The native Android APIs do not operate directly with filenames, but
instead operate on resource IDs. When you compile an Android application that uses resources,
the build system will package the resources for distribution and generate a class called "R"
(this is an Android convention) that contains the tokens for each one of the resources
included. For example, for the above Resources layout, this is what the R class would expose:
public class R {
public class drawable {
public const int icon = 0x123;
}
public class layout {
public const int main = 0x456;
}
public class strings {
public const int first_string = 0xabc;
public const int second_string = 0xbcd;
}
}
You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
to reference the layout/main.axml file, or R.strings.first_string to reference the first
string in the dictionary file values/strings.xml.
#pragma warning disable 1591
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Mono Runtime Version: 4.0.30319.17020
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
[assembly: Android.Runtime.ResourceDesignerAttribute("NLuaTests.Android.Resource", IsApplication=true)]
namespace NLuaTests.Android
{
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
public partial class Resource
{
static Resource()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
public static void UpdateIdValues()
{
global::Xamarin.Android.NUnitLite.Resource.Id.OptionHostName = global::NLuaTests.Android.Resource.Id.OptionHostName;
global::Xamarin.Android.NUnitLite.Resource.Id.OptionPort = global::NLuaTests.Android.Resource.Id.OptionPort;
global::Xamarin.Android.NUnitLite.Resource.Id.OptionRemoteServer = global::NLuaTests.Android.Resource.Id.OptionRemoteServer;
global::Xamarin.Android.NUnitLite.Resource.Id.OptionsButton = global::NLuaTests.Android.Resource.Id.OptionsButton;
global::Xamarin.Android.NUnitLite.Resource.Id.ResultFullName = global::NLuaTests.Android.Resource.Id.ResultFullName;
global::Xamarin.Android.NUnitLite.Resource.Id.ResultMessage = global::NLuaTests.Android.Resource.Id.ResultMessage;
global::Xamarin.Android.NUnitLite.Resource.Id.ResultResultState = global::NLuaTests.Android.Resource.Id.ResultResultState;
global::Xamarin.Android.NUnitLite.Resource.Id.ResultRunSingleMethodTest = global::NLuaTests.Android.Resource.Id.ResultRunSingleMethodTest;
global::Xamarin.Android.NUnitLite.Resource.Id.ResultStackTrace = global::NLuaTests.Android.Resource.Id.ResultStackTrace;
global::Xamarin.Android.NUnitLite.Resource.Id.ResultsFailed = global::NLuaTests.Android.Resource.Id.ResultsFailed;
global::Xamarin.Android.NUnitLite.Resource.Id.ResultsId = global::NLuaTests.Android.Resource.Id.ResultsId;
global::Xamarin.Android.NUnitLite.Resource.Id.ResultsIgnored = global::NLuaTests.Android.Resource.Id.ResultsIgnored;
global::Xamarin.Android.NUnitLite.Resource.Id.ResultsInconclusive = global::NLuaTests.Android.Resource.Id.ResultsInconclusive;
global::Xamarin.Android.NUnitLite.Resource.Id.ResultsMessage = global::NLuaTests.Android.Resource.Id.ResultsMessage;
global::Xamarin.Android.NUnitLite.Resource.Id.ResultsPassed = global::NLuaTests.Android.Resource.Id.ResultsPassed;
global::Xamarin.Android.NUnitLite.Resource.Id.ResultsResult = global::NLuaTests.Android.Resource.Id.ResultsResult;
global::Xamarin.Android.NUnitLite.Resource.Id.RunTestsButton = global::NLuaTests.Android.Resource.Id.RunTestsButton;
global::Xamarin.Android.NUnitLite.Resource.Id.TestSuiteListView = global::NLuaTests.Android.Resource.Id.TestSuiteListView;
global::Xamarin.Android.NUnitLite.Resource.Layout.options = global::NLuaTests.Android.Resource.Layout.options;
global::Xamarin.Android.NUnitLite.Resource.Layout.results = global::NLuaTests.Android.Resource.Layout.results;
global::Xamarin.Android.NUnitLite.Resource.Layout.test_result = global::NLuaTests.Android.Resource.Layout.test_result;
global::Xamarin.Android.NUnitLite.Resource.Layout.test_suite = global::NLuaTests.Android.Resource.Layout.test_suite;
}
public partial class Attribute
{
static Attribute()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Attribute()
{
}
}
public partial class Drawable
{
// aapt resource value: 0x7f020000
public const int Icon = 2130837504;
static Drawable()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Drawable()
{
}
}
public partial class Id
{
// aapt resource value: 0x7f040001
public const int OptionHostName = 2130968577;
// aapt resource value: 0x7f040002
public const int OptionPort = 2130968578;
// aapt resource value: 0x7f040000
public const int OptionRemoteServer = 2130968576;
// aapt resource value: 0x7f040010
public const int OptionsButton = 2130968592;
// aapt resource value: 0x7f04000b
public const int ResultFullName = 2130968587;
// aapt resource value: 0x7f04000d
public const int ResultMessage = 2130968589;
// aapt resource value: 0x7f04000c
public const int ResultResultState = 2130968588;
// aapt resource value: 0x7f04000a
public const int ResultRunSingleMethodTest = 2130968586;
// aapt resource value: 0x7f04000e
public const int ResultStackTrace = 2130968590;
// aapt resource value: 0x7f040006
public const int ResultsFailed = 2130968582;
// aapt resource value: 0x7f040003
public const int ResultsId = 2130968579;
// aapt resource value: 0x7f040007
public const int ResultsIgnored = 2130968583;
// aapt resource value: 0x7f040008
public const int ResultsInconclusive = 2130968584;
// aapt resource value: 0x7f040009
public const int ResultsMessage = 2130968585;
// aapt resource value: 0x7f040005
public const int ResultsPassed = 2130968581;
// aapt resource value: 0x7f040004
public const int ResultsResult = 2130968580;
// aapt resource value: 0x7f04000f
public const int RunTestsButton = 2130968591;
// aapt resource value: 0x7f040011
public const int TestSuiteListView = 2130968593;
static Id()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Id()
{
}
}
public partial class Layout
{
// aapt resource value: 0x7f030000
public const int options = 2130903040;
// aapt resource value: 0x7f030001
public const int results = 2130903041;
// aapt resource value: 0x7f030002
public const int test_result = 2130903042;
// aapt resource value: 0x7f030003
public const int test_suite = 2130903043;
static Layout()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Layout()
{
}
}
}
}
#pragma warning restore 1591
param ([string] $PackageId, [string] $NuSpecFile)
. .\BuildFunctions.ps1
$hash = Get-Current-Commit-Hash
$releaseNotes = "Release: $($hash)"
Update-NuSpec-Release-Notes $NuSpecFile $releaseNotes
& nuget pack $NuSpecFile
\ No newline at end of file
param ([string] $PackageId, [string] $NuSpecFile)
. ./BuildFunctions.ps1
$nextVersion = Get-Next-Version-String $PackageId
Update-NuSpec-Version $NuSpecFile $nextVersion
gitversion /updateassemblyinfo
Projects Using NLua
===================
* https://github.com/R1cebank/AmiMat Simple tool to make simple animations
* https://github.com/motord/cottontail
* https://github.com/revcore/revcore Yulgang Emulator Revolution Core
http://revcore.meximas.com
* https://github.com/biscuitWizard/Angels_8 An interactive fiction video game based on post-cyberpunk media such as Transmetropolitan.
* https://github.com/Craftitude-Team/Craftitude New minecraft launcher allowing one-click mod installation and much more!
* https://github.com/noogai03sprojects/AerialArchitect An RTS about building floating cities.
* https://github.com/evoxalien/Lua2012
* https://github.com/viniciusjarina/SpriteLua NLua + SpriteKit sample.
* https://github.com/codefoco/NLuaBox NLua iOS Application
* https://github.com/drew-r/Goose Runtime C# compilation and integrated Lua scripting for fun and profit.
* https://github.com/cmark89/Eglantine A spooky point-and-click adventure game.
* https://github.com/zeta0134/drunken-archer My individual project for Game Programming at TAMUCC in Spring of 2014
* https://github.com/MasterQ32/OpenWorld.Engine A C# game engine based on OpenGL and OpenTK.
* https://github.com/nrother/dynamiclua Wrapper for NLua, making access to lua more idomatic from .NET. Heavily using the "dynamic" keyword.
* https://github.com/OpenRA/OpenRA An open-source implementation of the Red Alert engine using .NET/mono and OpenGL. Runs on Windows, Linux and Mac OS X.
http://open-ra.org
* https://github.com/TheBerkin/RNGTV Watch randomly generated TV shows with your friends.
* https://github.com/prabirshrestha/vs-erc ~/.erc for Visual Studio
* https://github.com/umby24/Hypercube Hypercube Classic Minecraft Server
* https://github.com/RustOxide/Oxide Oxide is a modding API for the game Rust.
* https://github.com/drew-r/Maverick
* https://github.com/Schumix/Schumix2 Schumix2 C# IRC Bot and Framework
http://schumix.eu
* https://github.com/bertjohnson/Multipath Video search engine and Plex channel.
http://multipath.tv
* https://github.com/Mitch528/SharpStar A Starbound proxy server with support for Javascript and Lua plugins
* https://github.com/XepicxnoobX/XepicxnoobX.xna.lib General API and Engine
* https://github.com/GregoryLand/Lorei Lorei
* https://github.com/Rush-Forward/Amarathia Amarathia is a time-travel retro 2D MMORPG inspired by Nexus TK and developed by our awesome team of game enthusiasts.
* https://github.com/okdhryk/RtcMyTask
param ([string] $PackageId)
. .\BuildFunctions.ps1
if (-Not (Test-Should-Deploy)) {
return
}
$nextVersion = Get-Next-Version-String $PackageId
if (Test-Package-Already-Published $PackageId $nextVersion) {
return
}
$versionToUnlist = ""
if (-Not (Test-Version-Stable-Release $nextVersion)) {
$publishedVersion = Get-Published-PreRelase-Package $PackageId
if (-Not (Test-Version-Stable-Release $publishedVersion)) {
$versionToUnlist = $publishedVersion
}
}
& nuget push *.nupkg -Source https://www.nuget.org/api/v2/package
# Unlist previous Pre-Release packages.
if ($versionToUnlist -ne "") {
& $nuget delete $versionToUnlist -Source https://www.nuget.org/api/v2/package
}
\ No newline at end of file
NLua
========
[![Logo](https://secure.gravatar.com/avatar/77ecf0fb9d8419be7715c6e822e66562?s=150)]()
NLua is a fork project of LuaInterface (from Fábio Mascarenhas/Craig Presti).
[![Logo](https://raw.githubusercontent.com/NLua/NLua/master/NLua.png)]()
[![Cmd](https://raw.github.com/NLua/NLua/master/NLuaCommand.gif)]()
Example: using NLua from command line.
NLua allows the usage of Lua from C#, on Windows, Linux, Mac, iOS , Android, Windows Phone 7 and 8.
Unity3D support branch: [unity3d](https://github.com/Mervill/Unity3D-NLua) by [Riley G](https://github.com/Mervill/Unity3D-NLua).
NLua
=======
[1]: https://www.dropbox.com/s/w99igtc12uocq4k/NLua.OSX.zip
[2]: http://nvlabs.github.com/cub/download-icon.png (Download for OSX)
[3]: https://www.dropbox.com/s/s3xte19719446lx/NLua.iOS.zip
[4]: http://nvlabs.github.com/cub/download-icon.png (Download for iOS)
| NuGet | NuGet (Pre-Release) |
| ------|------|
|[![nuget](https://img.shields.io/nuget/v/NLua.svg)](https://www.nuget.org/packages/NLua)|[![nuget](https://img.shields.io/nuget/vpre/NLua.svg)](https://www.nuget.org/packages/NLua)|
| | Status |
| :------ | :------: |
| **Linux** | [![Linux](https://travis-ci.org/NLua/NLua.svg?branch=master)](https://travis-ci.org/NLua/NLua) |
| **AppVeyor** | [![Build status](https://ci.appveyor.com/api/projects/status/jkqcy9m9k35jwolx?svg=true)](https://ci.appveyor.com/project/viniciusjarina/NLua)|
|**Mac (Azure Pipelines)** | [![Build Status](https://dev.azure.com/NLua/NLua/_apis/build/status/NLua-NLua.Mac?branchName=master)](https://dev.azure.com/NLua/NLua/_build/latest?definitionId=2&branchName=master) |
|**Windows (Azure Pipelines)** | [![Build Status](https://dev.azure.com/NLua/NLua/_apis/build/status/NLua-NLua.Windows?branchName=master)](https://dev.azure.com/NLua/NLua/_build/latest?definitionId=4&branchName=master) |
[5]: https://www.dropbox.com/s/mjet2sh67e7y6xo/NLua.Android.zip
[6]: http://nvlabs.github.com/cub/download-icon.png (Download for Android)
[7]: https://www.dropbox.com/s/jkr1pnwvqw6w0r8/NLua.Win32.zip
[8]: http://nvlabs.github.com/cub/download-icon.png (Download for Win32)
Bridge between Lua world and the .NET (compatible with Xamarin.iOS/Mac/Android/.NET/.NET Core)
[9]: https://www.dropbox.com/s/xraxkgi2kuwbu4a/NLua.Win64.zip
[10]: http://nvlabs.github.com/cub/download-icon.png (Download for Win64)
Building
---------
[11]: https://www.dropbox.com/s/do8m3929mf0pwff/NLua.NoPInvoke.zip
[12]: http://nvlabs.github.com/cub/download-icon.png (Download Pure C# - No P/Invoke)
msbuild
[13]: https://www.dropbox.com/s/c08wphdmk5o7tdx/NLua.WP7.zip
[14]: http://nvlabs.github.com/cub/download-icon.png (Download for Windows Phone 7)
[15]: https://www.dropbox.com/s/2pva1tyxpnn7feb/NLua.WPSL8.zip
[16]: http://nvlabs.github.com/cub/download-icon.png (Download for Windows Phone Silverlight 8 (ARM+x86))
=============================
[17]: https://www.dropbox.com/s/nonijkic8216f7l/NLua.WinRT.zip
[18]: http://nvlabs.github.com/cub/download-icon.png (Download for Windows Phone 8 (RT) (ARM+x86))
NLua allows the usage of Lua from C#, on Windows, Linux, Mac, iOS , Android.
[19]: https://dl.dropboxusercontent.com/u/17523659/NLua.Unity3D.zip
[20]: http://nvlabs.github.com/cub/download-icon.png (Download for Unity3D)
[![Cmd](https://raw.github.com/NLua/NLua/master/extras/screenshot/NLuaCommand.gif)]()
| | Build Status | Download |
| :------ | ------: | :------: |
| **Linux** | [![Linux](https://travis-ci.org/NLua/NLua.svg?branch=master)](https://travis-ci.org/NLua/NLua) |
| **OSX** | [![OSX](http://codefoco.zapto.org:8085/buildStatus/icon?job=NLua_OSX)](http://codefoco.zapto.org:8085/job/NLua_OSX/) | [![dwn_osx][2]][1] |
| **iOS** | [![Build Status](http://codefoco.zapto.org:8085/buildStatus/icon?job=NLua_iOS)](http://codefoco.zapto.org:8085/view/X/job/NLua_iOS/) | [![dwn_ios][4]][3] |
| **Android** | [![Build Status](http://codefoco.zapto.org:8085/buildStatus/icon?job=NLua_Android)](http://codefoco.zapto.org:8085/view/X/job/NLua_Android/) | [![dwn_android][6]][5] |
| **Win32** | [![Build Status](http://codefoco.zapto.org:8085/buildStatus/icon?job=NLua_Windows)](http://codefoco.zapto.org:8085/view/X/job/NLua_Windows/) | [![dwn_w32][8]][7] |
| **Win64** | [![Build Status](http://codefoco.zapto.org:8085/buildStatus/icon?job=NLua_Win64)](http://codefoco.zapto.org:8085/view/X/job/NLua_Win64/) | [![dwn_w64][10]][9] |
| **.NET Pure C#** | [![Build Status](http://codefoco.zapto.org:8085/buildStatus/icon?job=NLua_WinSafe)](http://codefoco.zapto.org:8085/view/X/job/NLua_WinSafe/) | [![dwn_winsafe][12]][11] |
| **WP8 (Silverlight)** | [![Build Status](http://codefoco.zapto.org:8085/buildStatus/icon?job=NLua_WPSL8)](http://codefoco.zapto.org:8085/view/X/job/NLua_WinSafe/) | [![dwn_wpsl8][16]][15] |
| **WP8 (WinRT)** | [![Build Status](http://codefoco.zapto.org:8085/buildStatus/icon?job=NLua_WPSL8)](http://codefoco.zapto.org:8085/view/X/job/NLua_WP8/) | [![dwn_wp8][18]][17] |
| **Windows Phone 7** | | [![dwn_wp7][14]][13] |
| **Unity3D** | | [![dwn_unity3d][20]][19] |
NLua is a fork project of LuaInterface (from Fábio Mascarenhas/Craig Presti).
Example:
You can use/instantiate any .NET class without any previous registration or annotation.
......@@ -216,7 +189,17 @@ You can re-write the `import` function before load the user script and if the us
[Lua-Sandbox user-list](http://lua-users.org/wiki/SandBoxes)
Copyright (c) 2014 Vinicius Jarina (viniciusjarina@gmail.com)
Copyright (c) 2019 Vinicius Jarina (viniciusjarina@gmail.com)
NLua 1.4.x
----------
NLua huge cleanup and refactor after a few years.
* Moved to .NET C# style.
* Using KeraLua as nuget dependencie.
* Droped support for KopiLua/Silverlight/Windows Phone
NLua 1.3.2
----------
......@@ -464,3 +447,6 @@ instead of
Make sure the assemblies of the types you are passing have been loaded, or the call
will fail. The test cases in src/TestLuaInterface/TestLua.cs have examples of the new
functions.
// Main.cs: Touch.Unit Simple Server
//
// Authors:
// Sebastien Pouliot <sebastien@xamarin.com>
//
// Copyright 2011-2012 Xamarin Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Diagnostics;
using System.Threading;
using Mono.Options;
// a simple, blocking (i.e. one device/app at the time), listener
class SimpleListener {
static byte[] buffer = new byte [16 * 1024];
TcpListener server;
IPAddress Address { get; set; }
int Port { get; set; }
string LogPath { get; set; }
string LogFile { get; set; }
bool AutoExit { get; set; }
public void Cancel ()
{
try {
server.Stop ();
} catch {
// We might have stopped already, so just swallow any exceptions.
}
}
public int Start ()
{
bool processed;
Console.WriteLine ("Touch.Unit Simple Server listening on: {0}:{1}", Address, Port);
server = new TcpListener (Address, Port);
try {
server.Start ();
do {
using (TcpClient client = server.AcceptTcpClient ()) {
processed = Processing (client);
}
} while (!AutoExit || !processed);
}
catch (Exception e) {
Console.WriteLine ("[{0}] : {1}", DateTime.Now, e);
return 1;
}
finally {
server.Stop ();
}
return 0;
}
public bool Processing (TcpClient client)
{
string logfile = Path.Combine (LogPath, LogFile ?? DateTime.UtcNow.Ticks.ToString () + ".log");
string remote = client.Client.RemoteEndPoint.ToString ();
Console.WriteLine ("Connection from {0} saving logs to {1}", remote, logfile);
using (FileStream fs = File.OpenWrite (logfile)) {
// a few extra bits of data only available from this side
string header = String.Format ("[Local Date/Time:\t{1}]{0}[Remote Address:\t{2}]{0}",
Environment.NewLine, DateTime.Now, remote);
byte[] array = Encoding.UTF8.GetBytes (header);
fs.Write (array, 0, array.Length);
fs.Flush ();
// now simply copy what we receive
int i;
int total = 0;
NetworkStream stream = client.GetStream ();
while ((i = stream.Read (buffer, 0, buffer.Length)) != 0) {
fs.Write (buffer, 0, i);
fs.Flush ();
total += i;
}
if (total < 16) {
// This wasn't a test run, but a connection from the app (on device) to find
// the ip address we're reachable on.
return false;
}
}
return true;
}
static void ShowHelp (OptionSet os)
{
Console.WriteLine ("Usage: mono Touch.Server.exe [options]");
os.WriteOptionDescriptions (Console.Out);
}
public static int Main (string[] args)
{
Console.WriteLine ("Touch.Unit Simple Server");
Console.WriteLine ("Copyright 2011, Xamarin Inc. All rights reserved.");
bool help = false;
string address = null;
string port = null;
string log_path = ".";
string log_file = null;
string launchdev = null;
string launchsim = null;
bool autoexit = false;
var os = new OptionSet () {
{ "h|?|help", "Display help", v => help = true },
{ "ip", "IP address to listen (default: Any)", v => address = v },
{ "port", "TCP port to listen (default: 16384)", v => port = v },
{ "logpath", "Path to save the log files (default: .)", v => log_path = v },
{ "logfile=", "Filename to save the log to (default: automatically generated)", v => log_file = v },
{ "launchdev=", "Run the specified app on a device (specify using bundle identifier)", v => launchdev = v },
{ "launchsim=", "Run the specified app on the simulator (specify using path to *.app directory)", v => launchsim = v },
{ "autoexit", "Exit the server once a test run has completed (default: false)", v => autoexit = true },
};
try {
os.Parse (args);
if (help)
ShowHelp (os);
var listener = new SimpleListener ();
IPAddress ip;
if (String.IsNullOrEmpty (address) || !IPAddress.TryParse (address, out ip))
listener.Address = IPAddress.Any;
ushort p;
if (UInt16.TryParse (port, out p))
listener.Port = p;
else
listener.Port = 16384;
listener.LogPath = log_path ?? ".";
listener.LogFile = log_file;
listener.AutoExit = autoexit;
if (launchdev != null) {
ThreadPool.QueueUserWorkItem ((v) => {
using (Process proc = new Process ()) {
StringBuilder procArgs = new StringBuilder ();
string sdk_root = Environment.GetEnvironmentVariable ("XCODE_DEVELOPER_ROOT");
if (!String.IsNullOrEmpty (sdk_root))
procArgs.Append ("--sdkroot ").Append (sdk_root);
procArgs.Append (" --launchdev ");
procArgs.Append (launchdev);
procArgs.Append (" -argument=-connection-mode -argument=none");
procArgs.Append (" -argument=-app-arg:-autostart");
procArgs.Append (" -argument=-app-arg:-autoexit");
procArgs.Append (" -argument=-app-arg:-enablenetwork");
procArgs.AppendFormat (" -argument=-app-arg:-hostport:{0}", listener.Port);
procArgs.Append (" -argument=-app-arg:-hostname:");
var ipAddresses = System.Net.Dns.GetHostEntry (System.Net.Dns.GetHostName ()).AddressList;
for (int i = 0; i < ipAddresses.Length; i++) {
if (i > 0)
procArgs.Append (',');
procArgs.Append (ipAddresses [i].ToString ());
}
proc.StartInfo.FileName = "/Developer/MonoTouch/usr/bin/mtouch";
proc.StartInfo.Arguments = procArgs.ToString ();
proc.Start ();
proc.WaitForExit ();
if (proc.ExitCode != 0)
listener.Cancel ();
}
});
}
if (launchsim != null) {
ThreadPool.QueueUserWorkItem ((v) => {
using (Process proc = new Process ()) {
StringBuilder output = new StringBuilder ();
StringBuilder procArgs = new StringBuilder ();
string sdk_root = Environment.GetEnvironmentVariable ("XCODE_DEVELOPER_ROOT");
if (!String.IsNullOrEmpty (sdk_root))
procArgs.Append ("--sdkroot ").Append (sdk_root);
procArgs.Append (" --launchsim ");
procArgs.Append (launchsim);
procArgs.Append (" -argument=-connection-mode -argument=none");
procArgs.Append (" -argument=-app-arg:-autostart");
procArgs.Append (" -argument=-app-arg:-autoexit");
procArgs.Append (" -argument=-app-arg:-enablenetwork");
procArgs.Append (" -argument=-app-arg:-hostname:127.0.0.1");
procArgs.AppendFormat (" -argument=-app-arg:-hostport:{0}", listener.Port);
proc.StartInfo.FileName = "/Developer/MonoTouch/usr/bin/mtouch";
proc.StartInfo.Arguments = procArgs.ToString ();
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardError = true;
proc.StartInfo.RedirectStandardOutput = true;
proc.ErrorDataReceived += delegate(object sender, DataReceivedEventArgs e) {
lock (output)
output.AppendLine (e.Data);
};
proc.OutputDataReceived += delegate(object sender, DataReceivedEventArgs e) {
lock (output)
output.AppendLine (e.Data);
};
proc.Start ();
proc.BeginErrorReadLine ();
proc.BeginOutputReadLine ();
proc.WaitForExit ();
if (proc.ExitCode != 0) {
listener.Cancel ();
Console.WriteLine (output.ToString ());
}
}
});
}
return listener.Start ();
} catch (OptionException oe) {
Console.WriteLine ("{0} for options '{1}'", oe.Message, oe.OptionName);
return 1;
} catch (Exception ex) {
Console.WriteLine (ex);
return 1;
}
}
}
\ No newline at end of file
//
// Options.cs
//
// Authors:
// Jonathan Pryor <jpryor@novell.com>
//
// Copyright (C) 2008 Novell (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Compile With:
// gmcs -debug+ -r:System.Core Options.cs -o:NDesk.Options.dll
// gmcs -debug+ -d:LINQ -r:System.Core Options.cs -o:NDesk.Options.dll
//
// The LINQ version just changes the implementation of
// OptionSet.Parse(IEnumerable<string>), and confers no semantic changes.
//
// A Getopt::Long-inspired option parsing library for C#.
//
// NDesk.Options.OptionSet is built upon a key/value table, where the
// key is a option format string and the value is a delegate that is
// invoked when the format string is matched.
//
// Option format strings:
// Regex-like BNF Grammar:
// name: .+
// type: [=:]
// sep: ( [^{}]+ | '{' .+ '}' )?
// aliases: ( name type sep ) ( '|' name type sep )*
//
// Each '|'-delimited name is an alias for the associated action. If the
// format string ends in a '=', it has a required value. If the format
// string ends in a ':', it has an optional value. If neither '=' or ':'
// is present, no value is supported. `=' or `:' need only be defined on one
// alias, but if they are provided on more than one they must be consistent.
//
// Each alias portion may also end with a "key/value separator", which is used
// to split option values if the option accepts > 1 value. If not specified,
// it defaults to '=' and ':'. If specified, it can be any character except
// '{' and '}' OR the *string* between '{' and '}'. If no separator should be
// used (i.e. the separate values should be distinct arguments), then "{}"
// should be used as the separator.
//
// Options are extracted either from the current option by looking for
// the option name followed by an '=' or ':', or is taken from the
// following option IFF:
// - The current option does not contain a '=' or a ':'
// - The current option requires a value (i.e. not a Option type of ':')
//
// The `name' used in the option format string does NOT include any leading
// option indicator, such as '-', '--', or '/'. All three of these are
// permitted/required on any named option.
//
// Option bundling is permitted so long as:
// - '-' is used to start the option group
// - all of the bundled options are a single character
// - at most one of the bundled options accepts a value, and the value
// provided starts from the next character to the end of the string.
//
// This allows specifying '-a -b -c' as '-abc', and specifying '-D name=value'
// as '-Dname=value'.
//
// Option processing is disabled by specifying "--". All options after "--"
// are returned by OptionSet.Parse() unchanged and unprocessed.
//
// Unprocessed options are returned from OptionSet.Parse().
//
// Examples:
// int verbose = 0;
// OptionSet p = new OptionSet ()
// .Add ("v", v => ++verbose)
// .Add ("name=|value=", v => Console.WriteLine (v));
// p.Parse (new string[]{"-v", "--v", "/v", "-name=A", "/name", "B", "extra"});
//
// The above would parse the argument string array, and would invoke the
// lambda expression three times, setting `verbose' to 3 when complete.
// It would also print out "A" and "B" to standard output.
// The returned array would contain the string "extra".
//
// C# 3.0 collection initializers are supported and encouraged:
// var p = new OptionSet () {
// { "h|?|help", v => ShowHelp () },
// };
//
// System.ComponentModel.TypeConverter is also supported, allowing the use of
// custom data types in the callback type; TypeConverter.ConvertFromString()
// is used to convert the value option to an instance of the specified
// type:
//
// var p = new OptionSet () {
// { "foo=", (Foo f) => Console.WriteLine (f.ToString ()) },
// };
//
// Random other tidbits:
// - Boolean options (those w/o '=' or ':' in the option format string)
// are explicitly enabled if they are followed with '+', and explicitly
// disabled if they are followed with '-':
// string a = null;
// var p = new OptionSet () {
// { "a", s => a = s },
// };
// p.Parse (new string[]{"-a"}); // sets v != null
// p.Parse (new string[]{"-a+"}); // sets v != null
// p.Parse (new string[]{"-a-"}); // sets v == null
//
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Globalization;
using System.IO;
using System.Runtime.Serialization;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
#if LINQ
using System.Linq;
#endif
#if TEST
using NDesk.Options;
#endif
#if NDESK_OPTIONS
namespace NDesk.Options
#else
namespace Mono.Options
#endif
{
public class OptionValueCollection : IList, IList<string> {
List<string> values = new List<string> ();
OptionContext c;
internal OptionValueCollection (OptionContext c)
{
this.c = c;
}
#region ICollection
void ICollection.CopyTo (Array array, int index) {(values as ICollection).CopyTo (array, index);}
bool ICollection.IsSynchronized {get {return (values as ICollection).IsSynchronized;}}
object ICollection.SyncRoot {get {return (values as ICollection).SyncRoot;}}
#endregion
#region ICollection<T>
public void Add (string item) {values.Add (item);}
public void Clear () {values.Clear ();}
public bool Contains (string item) {return values.Contains (item);}
public void CopyTo (string[] array, int arrayIndex) {values.CopyTo (array, arrayIndex);}
public bool Remove (string item) {return values.Remove (item);}
public int Count {get {return values.Count;}}
public bool IsReadOnly {get {return false;}}
#endregion
#region IEnumerable
IEnumerator IEnumerable.GetEnumerator () {return values.GetEnumerator ();}
#endregion
#region IEnumerable<T>
public IEnumerator<string> GetEnumerator () {return values.GetEnumerator ();}
#endregion
#region IList
int IList.Add (object value) {return (values as IList).Add (value);}
bool IList.Contains (object value) {return (values as IList).Contains (value);}
int IList.IndexOf (object value) {return (values as IList).IndexOf (value);}
void IList.Insert (int index, object value) {(values as IList).Insert (index, value);}
void IList.Remove (object value) {(values as IList).Remove (value);}
void IList.RemoveAt (int index) {(values as IList).RemoveAt (index);}
bool IList.IsFixedSize {get {return false;}}
object IList.this [int index] {get {return this [index];} set {(values as IList)[index] = value;}}
#endregion
#region IList<T>
public int IndexOf (string item) {return values.IndexOf (item);}
public void Insert (int index, string item) {values.Insert (index, item);}
public void RemoveAt (int index) {values.RemoveAt (index);}
private void AssertValid (int index)
{
if (c.Option == null)
throw new InvalidOperationException ("OptionContext.Option is null.");
if (index >= c.Option.MaxValueCount)
throw new ArgumentOutOfRangeException ("index");
if (c.Option.OptionValueType == OptionValueType.Required &&
index >= values.Count)
throw new OptionException (string.Format (
c.OptionSet.MessageLocalizer ("Missing required value for option '{0}'."), c.OptionName),
c.OptionName);
}
public string this [int index] {
get {
AssertValid (index);
return index >= values.Count ? null : values [index];
}
set {
values [index] = value;
}
}
#endregion
public List<string> ToList ()
{
return new List<string> (values);
}
public string[] ToArray ()
{
return values.ToArray ();
}
public override string ToString ()
{
return string.Join (", ", values.ToArray ());
}
}
public class OptionContext {
private Option option;
private string name;
private int index;
private OptionSet set;
private OptionValueCollection c;
public OptionContext (OptionSet set)
{
this.set = set;
this.c = new OptionValueCollection (this);
}
public Option Option {
get {return option;}
set {option = value;}
}
public string OptionName {
get {return name;}
set {name = value;}
}
public int OptionIndex {
get {return index;}
set {index = value;}
}
public OptionSet OptionSet {
get {return set;}
}
public OptionValueCollection OptionValues {
get {return c;}
}
}
public enum OptionValueType {
None,
Optional,
Required,
}
public abstract class Option {
string prototype, description;
string[] names;
OptionValueType type;
int count;
string[] separators;
protected Option (string prototype, string description)
: this (prototype, description, 1)
{
}
protected Option (string prototype, string description, int maxValueCount)
{
if (prototype == null)
throw new ArgumentNullException ("prototype");
if (prototype.Length == 0)
throw new ArgumentException ("Cannot be the empty string.", "prototype");
if (maxValueCount < 0)
throw new ArgumentOutOfRangeException ("maxValueCount");
this.prototype = prototype;
this.names = prototype.Split ('|');
this.description = description;
this.count = maxValueCount;
this.type = ParsePrototype ();
if (this.count == 0 && type != OptionValueType.None)
throw new ArgumentException (
"Cannot provide maxValueCount of 0 for OptionValueType.Required or " +
"OptionValueType.Optional.",
"maxValueCount");
if (this.type == OptionValueType.None && maxValueCount > 1)
throw new ArgumentException (
string.Format ("Cannot provide maxValueCount of {0} for OptionValueType.None.", maxValueCount),
"maxValueCount");
if (Array.IndexOf (names, "<>") >= 0 &&
((names.Length == 1 && this.type != OptionValueType.None) ||
(names.Length > 1 && this.MaxValueCount > 1)))
throw new ArgumentException (
"The default option handler '<>' cannot require values.",
"prototype");
}
public string Prototype {get {return prototype;}}
public string Description {get {return description;}}
public OptionValueType OptionValueType {get {return type;}}
public int MaxValueCount {get {return count;}}
public string[] GetNames ()
{
return (string[]) names.Clone ();
}
public string[] GetValueSeparators ()
{
if (separators == null)
return new string [0];
return (string[]) separators.Clone ();
}
#if NOTYPECONVERTER
protected static T Parse<T> (string value, OptionContext c)
{
if (typeof (T) == typeof (int))
return (T) (object) int.Parse (value);
else if (typeof (T) == typeof (string))
return (T) (object) value;
throw new OptionException ("Could not convert parameter", c.OptionName, null);
}
#else
protected static T Parse<T> (string value, OptionContext c)
{
Type tt = typeof (T);
bool nullable = tt.IsValueType && tt.IsGenericType &&
!tt.IsGenericTypeDefinition &&
tt.GetGenericTypeDefinition () == typeof (Nullable<>);
Type targetType = nullable ? tt.GetGenericArguments () [0] : typeof (T);
TypeConverter conv = TypeDescriptor.GetConverter (targetType);
T t = default (T);
try {
if (value != null)
t = (T) conv.ConvertFromString (value);
}
catch (Exception e) {
throw new OptionException (
string.Format (
c.OptionSet.MessageLocalizer ("Could not convert string `{0}' to type {1} for option `{2}'."),
value, targetType.Name, c.OptionName),
c.OptionName, e);
}
return t;
}
#endif
internal string[] Names {get {return names;}}
internal string[] ValueSeparators {get {return separators;}}
static readonly char[] NameTerminator = new char[]{'=', ':'};
private OptionValueType ParsePrototype ()
{
char type = '\0';
List<string> seps = new List<string> ();
for (int i = 0; i < names.Length; ++i) {
string name = names [i];
if (name.Length == 0)
throw new ArgumentException ("Empty option names are not supported.", "prototype");
int end = name.IndexOfAny (NameTerminator);
if (end == -1)
continue;
names [i] = name.Substring (0, end);
if (type == '\0' || type == name [end])
type = name [end];
else
throw new ArgumentException (
string.Format ("Conflicting option types: '{0}' vs. '{1}'.", type, name [end]),
"prototype");
AddSeparators (name, end, seps);
}
if (type == '\0')
return OptionValueType.None;
if (count <= 1 && seps.Count != 0)
throw new ArgumentException (
string.Format ("Cannot provide key/value separators for Options taking {0} value(s).", count),
"prototype");
if (count > 1) {
if (seps.Count == 0)
this.separators = new string[]{":", "="};
else if (seps.Count == 1 && seps [0].Length == 0)
this.separators = null;
else
this.separators = seps.ToArray ();
}
return type == '=' ? OptionValueType.Required : OptionValueType.Optional;
}
private static void AddSeparators (string name, int end, ICollection<string> seps)
{
int start = -1;
for (int i = end+1; i < name.Length; ++i) {
switch (name [i]) {
case '{':
if (start != -1)
throw new ArgumentException (
string.Format ("Ill-formed name/value separator found in \"{0}\".", name),
"prototype");
start = i+1;
break;
case '}':
if (start == -1)
throw new ArgumentException (
string.Format ("Ill-formed name/value separator found in \"{0}\".", name),
"prototype");
seps.Add (name.Substring (start, i-start));
start = -1;
break;
default:
if (start == -1)
seps.Add (name [i].ToString ());
break;
}
}
if (start != -1)
throw new ArgumentException (
string.Format ("Ill-formed name/value separator found in \"{0}\".", name),
"prototype");
}
public void Invoke (OptionContext c)
{
OnParseComplete (c);
c.OptionName = null;
c.Option = null;
c.OptionValues.Clear ();
}
protected abstract void OnParseComplete (OptionContext c);
public override string ToString ()
{
return Prototype;
}
}
[Serializable]
public class OptionException : Exception {
private string option;
public OptionException ()
{
}
public OptionException (string message, string optionName)
: base (message)
{
this.option = optionName;
}
public OptionException (string message, string optionName, Exception innerException)
: base (message, innerException)
{
this.option = optionName;
}
protected OptionException (SerializationInfo info, StreamingContext context)
: base (info, context)
{
this.option = info.GetString ("OptionName");
}
public string OptionName {
get {return this.option;}
}
//[SecurityPermission (SecurityAction.LinkDemand, SerializationFormatter = true)]
public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
base.GetObjectData (info, context);
info.AddValue ("OptionName", option);
}
}
public delegate void OptionAction<TKey, TValue> (TKey key, TValue value);
public class OptionSet : KeyedCollection<string, Option>
{
public OptionSet ()
: this (delegate (string f) {return f;})
{
}
public OptionSet (Converter<string, string> localizer)
{
this.localizer = localizer;
}
Converter<string, string> localizer;
public Converter<string, string> MessageLocalizer {
get {return localizer;}
}
protected override string GetKeyForItem (Option item)
{
if (item == null)
throw new ArgumentNullException ("option");
if (item.Names != null && item.Names.Length > 0)
return item.Names [0];
// This should never happen, as it's invalid for Option to be
// constructed w/o any names.
throw new InvalidOperationException ("Option has no names!");
}
[Obsolete ("Use KeyedCollection.this[string]")]
protected Option GetOptionForName (string option)
{
if (option == null)
throw new ArgumentNullException ("option");
try {
return base [option];
}
catch (KeyNotFoundException) {
return null;
}
}
protected override void InsertItem (int index, Option item)
{
base.InsertItem (index, item);
AddImpl (item);
}
protected override void RemoveItem (int index)
{
base.RemoveItem (index);
Option p = Items [index];
// KeyedCollection.RemoveItem() handles the 0th item
for (int i = 1; i < p.Names.Length; ++i) {
Dictionary.Remove (p.Names [i]);
}
}
protected override void SetItem (int index, Option item)
{
base.SetItem (index, item);
RemoveItem (index);
AddImpl (item);
}
private void AddImpl (Option option)
{
if (option == null)
throw new ArgumentNullException ("option");
List<string> added = new List<string> (option.Names.Length);
try {
// KeyedCollection.InsertItem/SetItem handle the 0th name.
for (int i = 1; i < option.Names.Length; ++i) {
Dictionary.Add (option.Names [i], option);
added.Add (option.Names [i]);
}
}
catch (Exception) {
foreach (string name in added)
Dictionary.Remove (name);
throw;
}
}
public new OptionSet Add (Option option)
{
base.Add (option);
return this;
}
sealed class ActionOption : Option {
Action<OptionValueCollection> action;
public ActionOption (string prototype, string description, int count, Action<OptionValueCollection> action)
: base (prototype, description, count)
{
if (action == null)
throw new ArgumentNullException ("action");
this.action = action;
}
protected override void OnParseComplete (OptionContext c)
{
action (c.OptionValues);
}
}
public OptionSet Add (string prototype, Action<string> action)
{
return Add (prototype, null, action);
}
public OptionSet Add (string prototype, string description, Action<string> action)
{
if (action == null)
throw new ArgumentNullException ("action");
Option p = new ActionOption (prototype, description, 1,
delegate (OptionValueCollection v) { action (v [0]); });
base.Add (p);
return this;
}
public OptionSet Add (string prototype, OptionAction<string, string> action)
{
return Add (prototype, null, action);
}
public OptionSet Add (string prototype, string description, OptionAction<string, string> action)
{
if (action == null)
throw new ArgumentNullException ("action");
Option p = new ActionOption (prototype, description, 2,
delegate (OptionValueCollection v) {action (v [0], v [1]);});
base.Add (p);
return this;
}
sealed class ActionOption<T> : Option {
Action<T> action;
public ActionOption (string prototype, string description, Action<T> action)
: base (prototype, description, 1)
{
if (action == null)
throw new ArgumentNullException ("action");
this.action = action;
}
protected override void OnParseComplete (OptionContext c)
{
action (Parse<T> (c.OptionValues [0], c));
}
}
sealed class ActionOption<TKey, TValue> : Option {
OptionAction<TKey, TValue> action;
public ActionOption (string prototype, string description, OptionAction<TKey, TValue> action)
: base (prototype, description, 2)
{
if (action == null)
throw new ArgumentNullException ("action");
this.action = action;
}
protected override void OnParseComplete (OptionContext c)
{
action (
Parse<TKey> (c.OptionValues [0], c),
Parse<TValue> (c.OptionValues [1], c));
}
}
public OptionSet Add<T> (string prototype, Action<T> action)
{
return Add (prototype, null, action);
}
public OptionSet Add<T> (string prototype, string description, Action<T> action)
{
return Add (new ActionOption<T> (prototype, description, action));
}
public OptionSet Add<TKey, TValue> (string prototype, OptionAction<TKey, TValue> action)
{
return Add (prototype, null, action);
}
public OptionSet Add<TKey, TValue> (string prototype, string description, OptionAction<TKey, TValue> action)
{
return Add (new ActionOption<TKey, TValue> (prototype, description, action));
}
protected virtual OptionContext CreateOptionContext ()
{
return new OptionContext (this);
}
#if LINQ
public List<string> Parse (IEnumerable<string> arguments)
{
bool process = true;
OptionContext c = CreateOptionContext ();
c.OptionIndex = -1;
var def = GetOptionForName ("<>");
var unprocessed =
from argument in arguments
where ++c.OptionIndex >= 0 && (process || def != null)
? process
? argument == "--"
? (process = false)
: !Parse (argument, c)
? def != null
? Unprocessed (null, def, c, argument)
: true
: false
: def != null
? Unprocessed (null, def, c, argument)
: true
: true
select argument;
List<string> r = unprocessed.ToList ();
if (c.Option != null)
c.Option.Invoke (c);
return r;
}
#else
public List<string> Parse (IEnumerable<string> arguments)
{
OptionContext c = CreateOptionContext ();
c.OptionIndex = -1;
bool process = true;
List<string> unprocessed = new List<string> ();
Option def = Contains ("<>") ? this ["<>"] : null;
foreach (string argument in arguments) {
++c.OptionIndex;
if (argument == "--") {
process = false;
continue;
}
if (!process) {
Unprocessed (unprocessed, def, c, argument);
continue;
}
if (!Parse (argument, c))
Unprocessed (unprocessed, def, c, argument);
}
if (c.Option != null)
c.Option.Invoke (c);
return unprocessed;
}
#endif
private static bool Unprocessed (ICollection<string> extra, Option def, OptionContext c, string argument)
{
if (def == null) {
extra.Add (argument);
return false;
}
c.OptionValues.Add (argument);
c.Option = def;
c.Option.Invoke (c);
return false;
}
private readonly Regex ValueOption = new Regex (
@"^(?<flag>--|-|/)(?<name>[^:=]+)((?<sep>[:=])(?<value>.*))?$");
protected bool GetOptionParts (string argument, out string flag, out string name, out string sep, out string value)
{
if (argument == null)
throw new ArgumentNullException ("argument");
flag = name = sep = value = null;
Match m = ValueOption.Match (argument);
if (!m.Success) {
return false;
}
flag = m.Groups ["flag"].Value;
name = m.Groups ["name"].Value;
if (m.Groups ["sep"].Success && m.Groups ["value"].Success) {
sep = m.Groups ["sep"].Value;
value = m.Groups ["value"].Value;
}
return true;
}
protected virtual bool Parse (string argument, OptionContext c)
{
if (c.Option != null) {
ParseValue (argument, c);
return true;
}
string f, n, s, v;
if (!GetOptionParts (argument, out f, out n, out s, out v))
return false;
Option p;
if (Contains (n)) {
p = this [n];
c.OptionName = f + n;
c.Option = p;
switch (p.OptionValueType) {
case OptionValueType.None:
c.OptionValues.Add (n);
c.Option.Invoke (c);
break;
case OptionValueType.Optional:
case OptionValueType.Required:
ParseValue (v, c);
break;
}
return true;
}
// no match; is it a bool option?
if (ParseBool (argument, n, c))
return true;
// is it a bundled option?
if (ParseBundledValue (f, string.Concat (n + s + v), c))
return true;
return false;
}
private void ParseValue (string option, OptionContext c)
{
if (option != null)
foreach (string o in c.Option.ValueSeparators != null
? option.Split (c.Option.ValueSeparators, StringSplitOptions.None)
: new string[]{option}) {
c.OptionValues.Add (o);
}
if (c.OptionValues.Count == c.Option.MaxValueCount ||
c.Option.OptionValueType == OptionValueType.Optional)
c.Option.Invoke (c);
else if (c.OptionValues.Count > c.Option.MaxValueCount) {
throw new OptionException (localizer (string.Format (
"Error: Found {0} option values when expecting {1}.",
c.OptionValues.Count, c.Option.MaxValueCount)),
c.OptionName);
}
}
private bool ParseBool (string option, string n, OptionContext c)
{
Option p;
string rn;
if (n.Length >= 1 && (n [n.Length-1] == '+' || n [n.Length-1] == '-') &&
Contains ((rn = n.Substring (0, n.Length-1)))) {
p = this [rn];
string v = n [n.Length-1] == '+' ? option : null;
c.OptionName = option;
c.Option = p;
c.OptionValues.Add (v);
p.Invoke (c);
return true;
}
return false;
}
private bool ParseBundledValue (string f, string n, OptionContext c)
{
if (f != "-")
return false;
for (int i = 0; i < n.Length; ++i) {
Option p;
string opt = f + n [i].ToString ();
string rn = n [i].ToString ();
if (!Contains (rn)) {
if (i == 0)
return false;
throw new OptionException (string.Format (localizer (
"Cannot bundle unregistered option '{0}'."), opt), opt);
}
p = this [rn];
switch (p.OptionValueType) {
case OptionValueType.None:
Invoke (c, opt, n, p);
break;
case OptionValueType.Optional:
case OptionValueType.Required: {
string v = n.Substring (i+1);
c.Option = p;
c.OptionName = opt;
ParseValue (v.Length != 0 ? v : null, c);
return true;
}
default:
throw new InvalidOperationException ("Unknown OptionValueType: " + p.OptionValueType);
}
}
return true;
}
private static void Invoke (OptionContext c, string name, string value, Option option)
{
c.OptionName = name;
c.Option = option;
c.OptionValues.Add (value);
option.Invoke (c);
}
private const int OptionWidth = 29;
public void WriteOptionDescriptions (TextWriter o)
{
foreach (Option p in this) {
int written = 0;
if (!WriteOptionPrototype (o, p, ref written))
continue;
if (written < OptionWidth)
o.Write (new string (' ', OptionWidth - written));
else {
o.WriteLine ();
o.Write (new string (' ', OptionWidth));
}
bool indent = false;
string prefix = new string (' ', OptionWidth+2);
foreach (string line in GetLines (localizer (GetDescription (p.Description)))) {
if (indent)
o.Write (prefix);
o.WriteLine (line);
indent = true;
}
}
}
bool WriteOptionPrototype (TextWriter o, Option p, ref int written)
{
string[] names = p.Names;
int i = GetNextOptionIndex (names, 0);
if (i == names.Length)
return false;
if (names [i].Length == 1) {
Write (o, ref written, " -");
Write (o, ref written, names [0]);
}
else {
Write (o, ref written, " --");
Write (o, ref written, names [0]);
}
for ( i = GetNextOptionIndex (names, i+1);
i < names.Length; i = GetNextOptionIndex (names, i+1)) {
Write (o, ref written, ", ");
Write (o, ref written, names [i].Length == 1 ? "-" : "--");
Write (o, ref written, names [i]);
}
if (p.OptionValueType == OptionValueType.Optional ||
p.OptionValueType == OptionValueType.Required) {
if (p.OptionValueType == OptionValueType.Optional) {
Write (o, ref written, localizer ("["));
}
Write (o, ref written, localizer ("=" + GetArgumentName (0, p.MaxValueCount, p.Description)));
string sep = p.ValueSeparators != null && p.ValueSeparators.Length > 0
? p.ValueSeparators [0]
: " ";
for (int c = 1; c < p.MaxValueCount; ++c) {
Write (o, ref written, localizer (sep + GetArgumentName (c, p.MaxValueCount, p.Description)));
}
if (p.OptionValueType == OptionValueType.Optional) {
Write (o, ref written, localizer ("]"));
}
}
return true;
}
static int GetNextOptionIndex (string[] names, int i)
{
while (i < names.Length && names [i] == "<>") {
++i;
}
return i;
}
static void Write (TextWriter o, ref int n, string s)
{
n += s.Length;
o.Write (s);
}
private static string GetArgumentName (int index, int maxIndex, string description)
{
if (description == null)
return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1);
string[] nameStart;
if (maxIndex == 1)
nameStart = new string[]{"{0:", "{"};
else
nameStart = new string[]{"{" + index + ":"};
for (int i = 0; i < nameStart.Length; ++i) {
int start, j = 0;
do {
start = description.IndexOf (nameStart [i], j);
} while (start >= 0 && j != 0 ? description [j++ - 1] == '{' : false);
if (start == -1)
continue;
int end = description.IndexOf ("}", start);
if (end == -1)
continue;
return description.Substring (start + nameStart [i].Length, end - start - nameStart [i].Length);
}
return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1);
}
private static string GetDescription (string description)
{
if (description == null)
return string.Empty;
StringBuilder sb = new StringBuilder (description.Length);
int start = -1;
for (int i = 0; i < description.Length; ++i) {
switch (description [i]) {
case '{':
if (i == start) {
sb.Append ('{');
start = -1;
}
else if (start < 0)
start = i + 1;
break;
case '}':
if (start < 0) {
if ((i+1) == description.Length || description [i+1] != '}')
throw new InvalidOperationException ("Invalid option description: " + description);
++i;
sb.Append ("}");
}
else {
sb.Append (description.Substring (start, i - start));
start = -1;
}
break;
case ':':
if (start < 0)
goto default;
start = i + 1;
break;
default:
if (start < 0)
sb.Append (description [i]);
break;
}
}
return sb.ToString ();
}
private static IEnumerable<string> GetLines (string description)
{
if (string.IsNullOrEmpty (description)) {
yield return string.Empty;
yield break;
}
int length = 80 - OptionWidth - 1;
int start = 0, end;
do {
end = GetLineEnd (start, length, description);
char c = description [end-1];
if (char.IsWhiteSpace (c))
--end;
bool writeContinuation = end != description.Length && !IsEolChar (c);
string line = description.Substring (start, end - start) +
(writeContinuation ? "-" : "");
yield return line;
start = end;
if (char.IsWhiteSpace (c))
++start;
length = 80 - OptionWidth - 2 - 1;
} while (end < description.Length);
}
private static bool IsEolChar (char c)
{
return !char.IsLetterOrDigit (c);
}
private static int GetLineEnd (int start, int length, string description)
{
int end = System.Math.Min (start + length, description.Length);
int sep = -1;
for (int i = start; i < end; ++i) {
if (description [i] == '\n')
return i+1;
if (IsEolChar (description [i]))
sep = i+1;
}
if (sep == -1 || end == description.Length)
return end;
return sep;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhone</Platform>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A1303AE1-2693-4DF7-A17B-20C2ABA1E2ED}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Touch.Server</RootNamespace>
<AssemblyName>Touch.Server</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;LINQ</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
<DefineConstants>LINQ</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="Options.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
#! /bin/sh
PROJECT=NLua.Net40
FILE=
CONFIGURE=configure.ac
: ${AUTOCONF=autoconf}
: ${AUTOHEADER=autoheader}
: ${AUTOMAKE=automake}
: ${LIBTOOLIZE=libtoolize}
: ${ACLOCAL=aclocal}
: ${LIBTOOL=libtool}
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd $srcdir
TEST_TYPE=-f
aclocalinclude="-I . $ACLOCAL_FLAGS"
DIE=0
($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have autoconf installed to compile $PROJECT."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have automake installed to compile $PROJECT."
echo "Get ftp://sourceware.cygnus.com/pub/automake/automake-1.4.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
(grep "^AM_PROG_LIBTOOL" $CONFIGURE >/dev/null) && {
($LIBTOOL --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`libtool' installed to compile $PROJECT."
echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
}
if test "$DIE" -eq 1; then
exit 1
fi
#test $TEST_TYPE $FILE || {
# echo "You must run this script in the top-level $PROJECT directory"
# exit 1
#}
if test -z "$*"; then
echo "I am going to run ./configure with no arguments - if you wish "
echo "to pass any to it, please specify them on the $0 command line."
fi
case $CC in
*xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
esac
(grep "^AM_PROG_LIBTOOL" $CONFIGURE >/dev/null) && {
echo "Running $LIBTOOLIZE ..."
$LIBTOOLIZE --force --copy
}
echo "Running $ACLOCAL $aclocalinclude ..."
$ACLOCAL $aclocalinclude
echo "Running $AUTOMAKE --gnu $am_opt ..."
$AUTOMAKE --add-missing --gnu $am_opt
echo "Running $AUTOCONF ..."
$AUTOCONF
echo Running $srcdir/configure $conf_flags "$@" ...
$srcdir/configure --enable-maintainer-mode $conf_flags "$@" \
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{401B1795-0B7C-4F20-AE9D-F8685D15A825}</ProjectGuid>
<ProjectGuid>{4B766E88-5872-4437-882D-C887A3C0CDF7}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>NLuaTests.Android</RootNamespace>
<AndroidApplication>True</AndroidApplication>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<RootNamespace>NLua.Android</RootNamespace>
<AssemblyName>NLua</AssemblyName>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AssemblyName>NLuaTest</AssemblyName>
<TargetFrameworkVersion>v4.0.3</TargetFrameworkVersion>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<OutputPath>..\..\lib\Debug\MonoAndroid</OutputPath>
<DefineConstants>DEBUG;__MOBILE__;__ANDROID__</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
<ConsolePause>false</ConsolePause>
<AndroidSupportedAbis>armeabi,armeabi-v7a,x86</AndroidSupportedAbis>
<JavaMaximumHeapSize>
</JavaMaximumHeapSize>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<OutputPath>..\..\lib\Release\MonoAndroid</OutputPath>
<DefineConstants>__MOBILE__;__ANDROID__</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidManagedSymbols>true</AndroidManagedSymbols>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
<ConsolePause>false</ConsolePause>
<AndroidSupportedAbis>armeabi;armeabi-v7a;x86</AndroidSupportedAbis>
<JavaMaximumHeapSize>
</JavaMaximumHeapSize>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="KeraLua, Version=0.1.14.0, Culture=neutral, PublicKeyToken=6a194c04b9c89217, processorArchitecture=MSIL">
<HintPath>..\..\packages\KeraLua.0.1.14\lib\MonoAndroid\KeraLua.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Mono.Android" />
<Reference Include="Xamarin.Android.NUnitLite" />
<Reference Include="System.Numerics" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
<Compile Include="Resources\Resource.designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="..\tests\Core.cs">
<Link>Core.cs</Link>
</Compile>
<Compile Include="..\tests\Entity.cs">
<Link>Entity.cs</Link>
</Compile>
<Compile Include="..\tests\LuaTests.cs">
<Link>LuaTests.cs</Link>
</Compile>
<Compile Include="..\tests\TestLua.cs">
<Link>TestLua.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="Resources\AboutResources.txt" />
<None Include="Assets\AboutAssets.txt" />
<None Include="Properties\AndroidManifest.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\Icon.png" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
<ItemGroup>
<ProjectReference Include="..\Core\NLua\NLua.Android.csproj">
<Project>{92E4BB6F-130D-4EB6-9F0E-80CD213ACE81}</Project>
<Name>NLua.Android</Name>
</ProjectReference>
<ProjectReference Include="..\Core\KeraLua\src\KeraLua.Android.csproj">
<Project>{7648657A-8012-49FE-B7BF-BC90F77AD742}</Project>
<Name>KeraLua.Android</Name>
</ProjectReference>
<None Include="packages.config" />
</ItemGroup>
<Import Project="..\..\src\NLua.Core.projitems" Label="Shared" Condition="Exists('..\..\src\NLua.Core.projitems')" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="KeraLua" version="0.1.14" targetFramework="monoandroid81" />
</packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{9238F6AA-2D63-4804-99D1-C279871F5669}</ProjectGuid>
<ProjectTypeGuids>{06FA79CB-D6CD-4721-BB4B-1BD202089C55};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>NLua</RootNamespace>
<AssemblyName>NLua</AssemblyName>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\lib\Debug\xamarintvos</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchDebug>true</MtouchDebug>
<MtouchNoSymbolStrip>true</MtouchNoSymbolStrip>
<MtouchFastDev>true</MtouchFastDev>
<IOSDebuggerPort>16365</IOSDebuggerPort>
<DeviceSpecificBuild>false</DeviceSpecificBuild>
<MtouchLink>
</MtouchLink>
<MtouchHttpClientHandler>
</MtouchHttpClientHandler>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\lib\Release\xamarintvos</OutputPath>
<DefineConstants>
</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchNoSymbolStrip>true</MtouchNoSymbolStrip>
<MtouchLink>SdkOnly</MtouchLink>
<MtouchHttpClientHandler>
</MtouchHttpClientHandler>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="KeraLua, Version=0.1.14.0, Culture=neutral, PublicKeyToken=6a194c04b9c89217, processorArchitecture=MSIL">
<HintPath>..\..\packages\KeraLua.0.1.14\lib\xamarintvos\KeraLua.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.TVOS" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="..\..\src\NLua.Core.projitems" Label="Shared" Condition="Exists('..\..\src\NLua.Core.projitems')" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\TVOS\Xamarin.TVOS.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="KeraLua" version="0.1.14" targetFramework="xamarintvos10" />
</packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{BF6A650F-AA7A-4A08-8ADA-08D9E73E1238}</ProjectGuid>
<ProjectTypeGuids>{FC940695-DFE0-4552-9F25-99AF4A5619A1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>NLua</RootNamespace>
<AssemblyName>NLua</AssemblyName>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\lib\Debug\xamarinwatchos</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchDebug>true</MtouchDebug>
<MtouchNoSymbolStrip>true</MtouchNoSymbolStrip>
<MtouchFastDev>true</MtouchFastDev>
<IOSDebuggerPort>64617</IOSDebuggerPort>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
<DeviceSpecificBuild>false</DeviceSpecificBuild>
<MtouchLink>
</MtouchLink>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\lib\Release\xamarinwatchos</OutputPath>
<DefineConstants>
</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchNoSymbolStrip>true</MtouchNoSymbolStrip>
<MtouchLink>SdkOnly</MtouchLink>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="KeraLua, Version=0.1.14.0, Culture=neutral, PublicKeyToken=6a194c04b9c89217, processorArchitecture=MSIL">
<HintPath>..\..\packages\KeraLua.0.1.14\lib\xamarinwatchos\KeraLua.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.WatchOS" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="..\..\src\NLua.Core.projitems" Label="Shared" Condition="Exists('..\..\src\NLua.Core.projitems')" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\WatchOS\Xamarin.WatchOS.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="KeraLua" version="0.1.14" targetFramework="xamarinwatchos10" />
</packages>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment