forked from dotnet/coreclr
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automated packaging of the ILAsm: zip x86/x64 +PDB & nupkg x86+x64 wi…
…thout PDB zip+PDB: https://github.com/3F/coreclr/releases nupkg: https://www.nuget.org/packages/ILAsm/ Added tools: * tools\gnt.bat - https://github.com/3F/GetNuTool * tools\hMSBuild.bat - https://github.com/3F/hMSBuild
- Loading branch information
Showing
11 changed files
with
776 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
param($ObjDir, $NativeVersionFile) | ||
|
||
$vNative = $ObjDir + $NativeVersionFile | ||
|
||
# {origin-major}.{origin-minor}.{mod-major}.{mod-minor}+SHA1 | ||
# ...............................^^^^^^^^^^^^^^^^^^^^^ .modversion | ||
|
||
$mdv = Get-Content ".\.modversion" | ||
$nvf = Get-Content $vNative | ||
|
||
$raw = ($nvf | Select-String -Pattern 'VER_PRODUCTVERSION_STR[^"]+"([^"]+)"').Matches.Groups[1].Value | ||
$v = ($raw | Select-String -Pattern '(\d+),(\d+),(\d+),(\d+)\s*@Commit:\s*([0-9a-fA-F]+)').Matches.Groups | ||
|
||
$modversion = '{0}.{1}.{2}' -f $v[1],$v[2],$mdv | ||
|
||
Add-Content $vNative ('#define VER_3FMOD_BSHA1_STR "{0}"' -f $v[5]) | ||
Add-Content $vNative ('#define VER_3FMOD_PRODUCT_STR "{0}+{1}"' -f $modversion,$v[5].Value.Substring(0, 9)) | ||
|
||
# ILAsm .nuspec | ||
|
||
$ILAsm = "ILAsm.nuspec" | ||
|
||
(Get-Content ".\$ILAsm").Replace('%Version%', $modversion) | Set-Content "$ObjDir\$ILAsm" | ||
|
||
Set-Content ($ObjDir + '.version.txt' ) ("{0}+{1}: {2}" -f $modversion, $v[5], 'https://github.com/3F/coreclr') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?xml version="1.0"?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd"> | ||
<metadata> | ||
<id>ILAsm</id> | ||
<version>%Version%</version> | ||
<title>[ ILAsm + ILDasm ] IL Assembler and Disassembler</title> | ||
<authors>github.com/3F/coreclr</authors> | ||
<owners>reg</owners> | ||
<licenseUrl>https://github.com/3F/coreclr/blob/master/LICENSE.TXT</licenseUrl> | ||
<projectUrl>https://github.com/3F/coreclr</projectUrl> | ||
<repository type="git" url="https://github.com/3F/coreclr" /> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<description>IL Assembler (ILAsm) + IL Disassembler (ILDasm) | ||
|
||
Custom version on .NET Core CLR (CoreCLR) 3.0 | ||
Target platforms: Win.x64 and Win.x86 | ||
|
||
%Version% | ||
_ _ _ _ _ _ | ||
|
||
https://github.com/3F/coreclr | ||
The MIT License (MIT) | ||
Specially for: https://github.com/3F/DllExport | ||
|
||
! Please note: You need to provide compatible converter of resources to obj COFF-format when assembling with ILAsm. | ||
Just use /CVRES (/CVR) key. | ||
``` | ||
~... /CVR=cvtres.exe | ||
``` | ||
Related issue: https://github.com/3F/coreclr/issues/2 | ||
|
||
PDB files are available through GitHub Releases: | ||
https://github.com/3F/coreclr/releases | ||
|
||
MSBuild Properties for this package: | ||
|
||
* $(ILAsm_RootPkg) - path to root folder of this package after install. | ||
* $(ILAsm_PathToBin) - path to `\bin` folder., eg.: $(ILAsm_PathToBin)Win.x64\ilasm.exe | ||
|
||
Custom use via GetNuTool | ||
======================================= | ||
gnt /p:ngpackages="ILAsm/%Version%" | ||
================== https://github.com/3F/GetNuTool | ||
</description> | ||
<summary>IL Assembler (ILAsm) + IL Disassembler (ILDasm). The MIT License (MIT).</summary> | ||
<releaseNotes> changelog: https://github.com/3F/coreclr/blob/master/changelog.txt </releaseNotes> | ||
<copyright>Copyright (c) .NET Foundation and Contributors</copyright> | ||
<tags>coreclr IL ILAsm ILDasm MSIL dotnet Assembler Disassembler compiler MIT native</tags> | ||
</metadata> | ||
</package> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
@echo off | ||
:: GetNuTool - Executable version | ||
:: Copyright (c) 2015-2018 Denis Kuzmin [ [email protected] ] | ||
:: https://github.com/3F/GetNuTool | ||
set aa=gnt.core | ||
set ab="%temp%\%random%%random%%aa%" | ||
if "%~1"=="-unpack" goto ag | ||
set ac=%* | ||
if defined __p_call if defined ac set ac=%ac:^^=^% | ||
set ad=%__p_msb% | ||
if defined ad goto ah | ||
if "%~1"=="-msbuild" goto ai | ||
for %%v in (4.0, 14.0, 12.0, 3.5, 2.0) do ( | ||
for /F "usebackq tokens=2* skip=2" %%a in ( | ||
`reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\%%v" /v MSBuildToolsPath 2^> nul` | ||
) do if exist %%b ( | ||
set ad="%%~b\MSBuild.exe" | ||
goto ah | ||
) | ||
) | ||
echo MSBuild was not found. Try -msbuild "fullpath" args 1>&2 | ||
exit/B 2 | ||
:ai | ||
shift | ||
set ad=%1 | ||
shift | ||
set ae=%ac:!= #__b_ECL## % | ||
setlocal enableDelayedExpansion | ||
set ae=!ae:%%=%%%%! | ||
:aj | ||
for /F "tokens=1* delims==" %%a in ("!ae!") do ( | ||
if "%%~b"=="" ( | ||
call :ak !ae! | ||
exit/B %ERRORLEVEL% | ||
) | ||
set ae=%%a #__b_EQ## %%b | ||
) | ||
goto aj | ||
:ak | ||
shift & shift | ||
set "ac=" | ||
:al | ||
set ac=!ac! %1 | ||
shift & if not "%~2"=="" goto al | ||
set ac=!ac: #__b_EQ## ==! | ||
setlocal disableDelayedExpansion | ||
set ac=%ac: #__b_ECL## =!% | ||
:ah | ||
call :am | ||
%ad% %ab% /nologo /p:wpath="%~dp0/" /v:m /m:4 %ac% | ||
set "ad=" | ||
set af=%ERRORLEVEL% | ||
del /Q/F %ab% | ||
exit/B %af% | ||
:ag | ||
set ab="%~dp0\%aa%" | ||
echo Generating minified version in %ab% ... | ||
:am | ||
<nul set /P ="">%ab% | ||
set a=PropertyGroup&set b=Condition&set c=ngpackages&set d=Target&set e=DependsOnTargets&set f=TaskCoreDllPath&set g=MSBuildToolsPath&set h=UsingTask&set i=CodeTaskFactory&set j=ParameterGroup&set k=Reference&set l=Include&set m=System&set n=Using&set o=Namespace&set p=IsNullOrEmpty&set q=return&set r=string&set s=delegate&set t=foreach&set u=WriteLine&set v=Combine&set w=Console.WriteLine&set x=Directory&set y=GetNuTool&set z=StringComparison&set _=EXT_NUSPEC | ||
<nul set /P =^<!-- GetNuTool - github.com/3F/GetNuTool --^>^<!-- Copyright (c) 2015-2018 Denis Kuzmin [ [email protected] ] --^>^<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"^>^<%a%^>^<ngconfig %b%="'$(ngconfig)'==''"^>packages.config^</ngconfig^>^<ngserver %b%="'$(ngserver)'==''"^>https://www.nuget.org/api/v2/package/^</ngserver^>^<%c% %b%="'$(%c%)'==''"^>^</%c%^>^<ngpath %b%="'$(ngpath)'==''"^>packages^</ngpath^>^</%a%^>^<%d% Name="get" BeforeTargets="Build" %e%="header"^>^<a^>^<Output PropertyName="plist" TaskParameter="Result"/^>^</a^>^<b plist="$(plist)"/^>^</%d%^>^<%d% Name="pack" %e%="header"^>^<c/^>^</%d%^>^<%a%^>^<%f% %b%="Exists('$(%g%)\Microsoft.Build.Tasks.v$(MSBuildToolsVersion).dll')"^>$(%g%)\Microsoft.Build.Tasks.v$(MSBuildToolsVersion).dll^</%f%^>^<%f% %b%="'$(%f%)'=='' and Exists('$(%g%)\Microsoft.Build.Tasks.Core.dll')"^>$(%g%)\Microsoft.Build.Tasks.Core.dll^</%f%^>^</%a%^>^<%h% TaskName="a" TaskFactory="%i%" AssemblyFile="$(%f%)"^>^<%j%^>^<Result Output="true"/^>^</%j%^>^<Task^>^<%k% %l%="%m%.Xml"/^>^<%k% %l%="%m%.Xml.Linq"/^>^<%n% %o%="%m%"/^>^<%n% %o%="%m%.Collections.Generic"/^>^<%n% %o%="%m%.IO"/^>^<%n% %o%="%m%.Xml.Linq"/^>^<Code Type="Fragment" Language="cs"^>^<![CDATA[var a=@"$(ngconfig)";var b=@"$(%c%)";var c=@"$(wpath)";if(!String.%p%(b)){Result=b;%q% true;}var d=Console.Error;Action^<%r%,Queue^<%r%^>^>e=%s%(%r% f,Queue^<%r%^>g){%t%(var h in XDocument.Load(f).Descendants("package")){var i=h.Attribute("id");var j=h.Attribute("version");var k=h.Attribute("output");if(i==null){d.%u%("'id' does not exist in '{0}'",f);%q%;}var l=i.Value;if(j!=null){l+="/"+j.Value;}if(k!=null){g.Enqueue(l+":"+k.Value);continue;}g.Enqueue(l);}};var m=new Queue^<%r%^>();%t%(var f in a.Split(new char[]{a.IndexOf('^|')!=-1?'^|':';'},(StringSplitOptions)1)){>>%ab% | ||
<nul set /P =var n=Path.%v%(c,f);if(File.Exists(n)){e(n,m);}else{d.%u%(".config '{0}' was not found.",n);}}if(m.Count^<1){d.%u%("Empty list. Use .config or /p:%c%=\"...\"\n");}else{Result=%r%.Join("|",m.ToArray());}]]^>^</Code^>^</Task^>^</%h%^>^<%h% TaskName="b" TaskFactory="%i%" AssemblyFile="$(%f%)"^>^<%j%^>^<plist/^>^</%j%^>^<Task^>^<%k% %l%="WindowsBase"/^>^<%n% %o%="%m%"/^>^<%n% %o%="%m%.IO"/^>^<%n% %o%="%m%.IO.Packaging"/^>^<%n% %o%="%m%.Net"/^>^<Code Type="Fragment" Language="cs"^>^<![CDATA[var a=@"$(ngserver)";var b=@"$(wpath)";var c=@"$(ngpath)";var d=@"$(proxycfg)";var e=@"$(debug)"=="true";if(plist==null){%q% false;}ServicePointManager.SecurityProtocol^|=SecurityProtocolType.Tls11^|SecurityProtocolType.Tls12;var f=new %r%[]{"/_rels/","/package/","/[Content_Types].xml"};Action^<%r%,object^>g=%s%(%r% h,object i){if(e){%w%(h,i);}};Func^<%r%,WebProxy^>j=%s%(%r% k){var l=k.Split('@');if(l.Length^<=1){%q% new WebProxy(l[0],false);}var m=l[0].Split(':');%q% new WebProxy(l[1],false){Credentials=new NetworkCredential(m[0],(m.Length^>1)?m[1]:null)};};Func^<%r%,%r%^>n=%s%(%r% i){%q% Path.%v%(b,i??"");};Action^<%r%,%r%,%r%^>o=%s%(%r% p,%r% q,%r% r){var s=Path.GetFullPath(n(r??q));if(%x%.Exists(s)){%w%("`{0}` is already exists: \"{1}\"",q,s);%q%;}Console.Write("Getting `{0}` ... ",p);var t=Path.%v%(Path.GetTempPath(),Guid.NewGuid().ToString());using(var u=new WebClient()){try{if(!String.%p%(d)){u.Proxy=j(d);}u.Headers.Add("User-Agent","%y% $(%y%)");u.UseDefaultCredentials=true;u.DownloadFile(a+p,t);}catch(Exception v){Console.Error.%u%(v.Message);%q%;}}%w%("Extracting into \"{0}\"",s);using(var w=ZipPackage.Open(t,FileMode.Open,FileAccess.Read)){%t%(var x in w.GetParts()){var y=Uri.UnescapeDataString(x.Uri.OriginalString);if(f.Any(z=^>y.StartsWith(z,%z%.Ordinal))){continue;}var _=Path.%v%(s,y.TrimStart(>>%ab% | ||
<nul set /P ='/'));g("- `{0}`",y);var aa=Path.GetDirectoryName(_);if(!%x%.Exists(aa)){%x%.CreateDirectory(aa);}using(Stream ab=x.GetStream(FileMode.Open,FileAccess.Read))using(var ac=File.OpenWrite(_)){try{ab.CopyTo(ac);}catch(FileFormatException v){g("[x]?crc: {0}",_);}}}}File.Delete(t);};%t%(var w in plist.Split(new char[]{plist.IndexOf('^|')!=-1?'^|':';'},(StringSplitOptions)1)){var ad=w.Split(new char[]{':'},2);var p=ad[0];var r=(ad.Length^>1)?ad[1]:null;var q=p.Replace('/','.');if(!String.%p%(c)){r=Path.%v%(c,r??q);}o(p,q,r);}]]^>^</Code^>^</Task^>^</%h%^>^<%h% TaskName="c" TaskFactory="%i%" AssemblyFile="$(%f%)"^>^<Task^>^<%k% %l%="%m%.Xml"/^>^<%k% %l%="%m%.Xml.Linq"/^>^<%k% %l%="WindowsBase"/^>^<%n% %o%="%m%"/^>^<%n% %o%="%m%.Collections.Generic"/^>^<%n% %o%="%m%.IO"/^>^<%n% %o%="%m%.Linq"/^>^<%n% %o%="%m%.IO.Packaging"/^>^<%n% %o%="%m%.Xml.Linq"/^>^<%n% %o%="%m%.Text.RegularExpressions"/^>^<Code Type="Fragment" Language="cs"^>^<![CDATA[var a=@"$(ngin)";var b=@"$(ngout)";var c=@"$(wpath)";var d=@"$(debug)"=="true";var %_%=".nuspec";var EXT_NUPKG=".nupkg";var TAG_META="metadata";var DEF_CONTENT_TYPE="application/octet";var MANIFEST_URL="http://schemas.microsoft.com/packaging/2010/07/manifest";var ID="id";var VER="version";Action^<%r%,object^>e=%s%(%r% f,object g){if(d){%w%(f,g);}};var h=Console.Error;a=Path.%v%(c,a);if(!%x%.Exists(a)){h.%u%("`{0}` was not found.",a);%q% false;}b=Path.%v%(c,b);var i=%x%.GetFiles(a,"*"+%_%,SearchOption.TopDirectoryOnly).FirstOrDefault();if(i==null){h.%u%("{0} was not found in `{1}`",%_%,a);%q% false;}%w%("Found {0}: `{1}`",%_%,i);var j=XDocument.Load(i).Root.Elements().FirstOrDefault(k=^>k.Name.LocalName==TAG_META);if(j==null){h.%u%("{0} does not contain {1}.",i,TAG_META);%q% false;}var l=new Dictionary^<%r%,%r%^>();%t%(var m in j.Elements()){l[m.Name.LocalName.ToL>>%ab% | ||
<nul set /P =ower()]=m.Value;}if(l[ID].Length^>100^|^|!Regex.IsMatch(l[ID],@"^\w+([_.-]\w+)*$",RegexOptions.IgnoreCase^|RegexOptions.ExplicitCapture)){h.%u%("The format of `{0}` is not correct.",ID);%q% false;}var n=new %r%[]{Path.%v%(a,"_rels"),Path.%v%(a,"package"),Path.%v%(a,"[Content_Types].xml")};var o=%r%.Format("{0}.{1}{2}",l[ID],l[VER],EXT_NUPKG);if(!String.IsNullOrWhiteSpace(b)){if(!%x%.Exists(b)){%x%.CreateDirectory(b);}o=Path.%v%(b,o);}%w%("Started packing `{0}` ...",o);using(var p=Package.Open(o,FileMode.Create)){Uri q=new Uri(String.Format("/{0}{1}",l[ID],%_%),UriKind.Relative);p.CreateRelationship(q,TargetMode.Internal,MANIFEST_URL);%t%(var r in %x%.GetFiles(a,"*.*",SearchOption.AllDirectories)){if(n.Any(k=^>r.StartsWith(k,%z%.Ordinal))){continue;}%r% s;if(r.StartsWith(a,%z%.OrdinalIgnoreCase)){s=r.Substring(a.Length).TrimStart(Path.DirectorySeparatorChar);}else{s=r;}e("- `{0}`",s);var t=%r%.Join("/",s.Split('\\','/').Select(g=^>Uri.EscapeDataString(g)));Uri u=PackUriHelper.CreatePartUri(new Uri(t,UriKind.Relative));var v=p.CreatePart(u,DEF_CONTENT_TYPE,CompressionOption.Maximum);using(Stream w=v.GetStream())using(var x=new FileStream(r,FileMode.Open,FileAccess.Read)){x.CopyTo(w);}}Func^<%r%,%r%^>y=%s%(%r% z){%q%(l.ContainsKey(z))?l[z]:"";};var _=p.PackageProperties;_.Creator=y("authors");_.Description=y("description");_.Identifier=l[ID];_.Version=l[VER];_.Keywords=y("tags");_.Title=y("title");_.LastModifiedBy="%y% $(%y%)";}]]^>^</Code^>^</Task^>^</%h%^>^<%d% Name="Build" %e%="get"/^>^<%a%^>^<%y%^>1.7.0.7737_4bc1dfb^</%y%^>^<wpath %b%="'$(wpath)'==''"^>$(MSBuildProjectDirectory)^</wpath^>^</%a%^>^<%d% Name="header"^>^<Message Text="%%0D%%0A%y% $(%y%) - github.com/3F%%0D%%0A=========%%0D%%0A" Importance="high"/^>^</%d%^>^</Project^>>>%ab% | ||
exit/B 0 |
Oops, something went wrong.