lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [58/62] [abbrv] lucenenet git commit: Added build.bat script for more concise build syntax
Date Tue, 04 Apr 2017 17:20:04 GMT
Added build.bat script for more concise build syntax


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/d24ffa06
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/d24ffa06
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/d24ffa06

Branch: refs/heads/api-work
Commit: d24ffa0636875c74295612c0635b070e3ab467ab
Parents: 20b8800
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Tue Apr 4 19:04:27 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Tue Apr 4 19:04:27 2017 +0700

----------------------------------------------------------------------
 build.bat | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d24ffa06/build.bat
----------------------------------------------------------------------
diff --git a/build.bat b/build.bat
new file mode 100644
index 0000000..9b03624
--- /dev/null
+++ b/build.bat
@@ -0,0 +1,81 @@
+@echo off
+GOTO endcommentblock
+:: -----------------------------------------------------------------------------------
+:: This file will build Lucene.Net and create the NuGet packages.
+::
+:: Syntax:
+::   build[.bat] [<options>]
+::
+:: Available Options:
+::
+::   -Version:<Version>
+::   -v:<Version> - Assembly version number. If not supplied, the version will be the
same 
+::                  as PackageVersion (excluding any pre-release tag).
+::
+::   -PackageVersion:<PackageVersion>
+::   -pv:<PackageVersion> - Nuget package version. Default is 1.0.0.
+::
+::   -Configuration:<Configuration>
+::   -config:<Configuration> - MSBuild configuration for the build.
+::
+::   All options are case insensitive.
+::
+::   To escape any of the options, put double quotes around the entire value, like this:
+::   "-config:Release"
+::
+:: -----------------------------------------------------------------------------------
+:endcommentblock
+setlocal enabledelayedexpansion enableextensions
+
+REM Default values
+IF "%version%" == "" (
+	:: If version is not supplied, our build script should parse it
+	:: from the %PackageVersion% variable. We determine this by checking
+	:: whether it is 0.0.0 (uninitialized).
+	set version=0.0.0
+)
+IF "%PackageVersion%" == "" (
+    set PackageVersion=1.0.0
+)
+set configuration=Release
+IF NOT "%config%" == "" (
+	set configuration=%config%
+)
+
+FOR %%a IN (%*) DO (
+	FOR /f "useback tokens=*" %%a in ('%%a') do (
+		set value=%%~a
+
+		set test=!value:~0,3!
+		IF /I !test! EQU -v: (
+			set version=!value:~3!
+		)
+
+		set test=!value:~0,9!
+		IF /I !test! EQU -version: (
+			set version=!value:~9!
+		)
+		
+		set test=!value:~0,4!
+		IF /I !test!==-pv: (
+			set packageversion=!value:~4!
+		)
+
+		set test=!value:~0,16!
+		IF /I !test!==-packageversion: (
+			set packageversion=!value:~16!
+		)
+
+		set test=!value:~0,8!
+		IF /I !test!==-config: (
+			set configuration=!value:~8!
+		)
+
+		set test=!value:~0,15!
+		IF /I !test!==-configuration: (
+			set configuration=!value:~15!
+		)
+	)
+)
+
+powershell -ExecutionPolicy Bypass -Command "& .\build.ps1 -Version \"%version%\" -PackageVersion
\"%PackageVersion%\" -Configuration \"%configuration%\" -CreatePackages"


Mime
View raw message