Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MSIX support #1522

Merged
merged 24 commits into from Jun 9, 2019
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
525ffea
Add YAML settings to editorconfig. Must use spaces
onovotny Jun 4, 2019
912b6b1
Update extras to 2.x, which is required for VS 2019
onovotny Jun 4, 2019
b34906e
Add Azure DevOps pipeline
onovotny Jun 4, 2019
d0d0e99
Use MSBuild locator API to find MSBuild. Fixes VS 2019 issue.
onovotny Jun 4, 2019
40053cc
Support both AppVeyor and Pipelines in assembly info script
onovotny Jun 4, 2019
c9b58de
Skip failing test on 2019 for now
onovotny Jun 4, 2019
c8d4398
fix copy glob
onovotny Jun 4, 2019
b88d8b0
Switch to UseWpf for compat with Extras 2.x and .NET Core SDK 3
onovotny Jun 4, 2019
366e0db
Latest version of VS first
onovotny Jun 5, 2019
b7a3831
Add packaging project for ILSpy
onovotny Jun 5, 2019
8a31bf3
IDE cleanup
onovotny Jun 5, 2019
ef42170
Add cmd line invocation (ilspyl for local)
onovotny Jun 5, 2019
aed76a5
Exclude wapproj generated directories
onovotny Jun 5, 2019
bc96297
Add packaging project with release channels
onovotny Jun 5, 2019
11c723e
Build channels
onovotny Jun 5, 2019
36b2003
Build solution instead of wapproj due to dependencies on SolutionDir
onovotny Jun 5, 2019
8408910
Bump TPV down to 17763 as the Pipelines pool doesn't have 18362 yet
onovotny Jun 5, 2019
4251f64
Set AppInstallerUri for CI build
onovotny Jun 5, 2019
13784aa
Add missing properties for AppInstaller
onovotny Jun 5, 2019
a9c4ba9
Don't include symbols due to fastlink error
onovotny Jun 5, 2019
77ccbd0
Version appxmanifests
onovotny Jun 5, 2019
a6ba044
Disable update checks when running in package
onovotny Jun 5, 2019
f9858c3
Merge branch 'master' of https://github.com/icsharpcode/ILSpy into on…
siegfriedpammer Jun 6, 2019
8869f69
Reenable test Cecil_net45
siegfriedpammer Jun 6, 2019
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -8,7 +8,9 @@ indent_size = 4
[*.il]
indent_style = space
indent_size = 2

[*.{yml,yaml}]
indent_style = space
indent_size = 2
[*.csproj]
indent_style = space
indent_size = 2
@@ -1,6 +1,7 @@
bin/
obj/

AppPackages/
BundleArtifacts/
/ICSharpCode.Decompiler/Properties/AssemblyInfo.cs
/ILSpy/Properties/AssemblyInfo.cs
/ILSpy/app.config
@@ -0,0 +1,40 @@
$ErrorActionPreference = "Stop"

$baseCommit = "d779383cb85003d6dabeb976f0845631e07bf463";
$baseCommitRev = 1;

# make sure this list matches artifacts-only branches list in azure-pipelines.yml!
$masterBranches = @("master", "3.2.x");

$globalAssemblyInfoTemplateFile = "ILSpy/Properties/AssemblyInfo.template.cs";

$versionParts = @{};
Get-Content $globalAssemblyInfoTemplateFile | where { $_ -match 'string (\w+) = "?(\w+)"?;' } | foreach { $versionParts.Add($Matches[1], $Matches[2]) }

$major = $versionParts.Major;
$minor = $versionParts.Minor;
$build = $versionParts.Build;
$versionName = $versionParts.VersionName;

if ($versionName -ne "null") {
$versionName = "-$versionName";
} else {
$versionName = "";
}
if ($masterBranches -contains $env:BUILD_SOURCEBRANCHNAME) {
$branch = "";
} else {
$branch = "-$env:BUILD_SOURCEBRANCHNAME";
}
if ($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER) {
$suffix = "-pr$env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER";
} else {
$suffix = "";
}

$revision = [Int32]::Parse((git rev-list --count "$baseCommit..HEAD")) + $baseCommitRev;

$newVersion="$major.$minor.$build.$revision";
$env:ILSPY_VERSION_NUMBER="$newVersion$branch$versionName$suffix";
Write-Host "##vso[build.updatebuildnumber]$newVersion$branch$versionName$suffix";
Write-Host "new version: $newVersion$branch$versionName$suffix";
@@ -57,8 +57,10 @@ function gitBranch() {
return "no-branch";
}

if ($env:APPVEYOR_REPO_BRANCH -ne $null) {
if ($env:APPVEYOR_REPO_BRANCH -ne $null) {
return $env:APPVEYOR_REPO_BRANCH;
} elseif ($env:BUILD_SOURCEBRANCHNAME -ne $null) {
return $env:BUILD_SOURCEBRANCHNAME;
} else {
return ((git branch --no-color).Split([System.Environment]::NewLine) | where { $_ -match "^\* " } | select -First 1).Substring(2);
}
@@ -71,6 +73,12 @@ $templateFiles = (
@{Input="ILSpy/Properties/app.config.template"; Output = "ILSpy/app.config"},
@{Input="ILSpy.AddIn/source.extension.vsixmanifest.template"; Output = "ILSpy.AddIn/source.extension.vsixmanifest"}
);

$appxmanifestFiles = (
@{Input="ILSpy.Package/Package.appxmanifest"; Output="ILSpy.Package/Package.appxmanifest"},
@{Input="ILSpy.Package/Package-CI.appxmanifest"; Output="ILSpy.Package/Package-CI.appxmanifest"}
);

[string]$mutexId = "ILSpyUpdateAssemblyInfo" + (Get-Location).ToString().GetHashCode();
Write-Host $mutexId;
[bool]$createdNew = $false;
@@ -142,6 +150,32 @@ try {
$out | Out-File -Encoding utf8 $file.Output;
}
}

# Only update these on the Build Agent when ReleaseChannel is set
if($Env:ReleaseChannel -ne '' -and $Env:ReleaseChannel -ne $null) {
foreach ($file in $appxmanifestFiles) {
[string]$in = (Get-Content $file.Input) -Join [System.Environment]::NewLine;

$out = $in.Replace('$INSERTVERSION$', $fullVersionNumber);
$out = $out.Replace('$INSERTMAJORVERSION$', $major);
$out = $out.Replace('$INSERTMINORVERSION$', $minor);
$out = $out.Replace('$INSERTREVISION$', $revision);
$out = $out.Replace('$INSERTCOMMITHASH$', $gitCommitHash);
$out = $out.Replace('$INSERTSHORTCOMMITHASH$', $gitCommitHash.Substring(0, 8));
$out = $out.Replace('$INSERTDATE$', [System.DateTime]::Now.ToString("MM/dd/yyyy"));
$out = $out.Replace('$INSERTYEAR$', [System.DateTime]::Now.Year.ToString());
$out = $out.Replace('$INSERTBRANCHNAME$', $branchName);
$out = $out.Replace('$INSERTBRANCHPOSTFIX$', $postfixBranchName);
$out = $out.Replace('$INSERTVERSIONNAME$', $versionName);
$out = $out.Replace('$INSERTVERSIONNAMEPOSTFIX$', $postfixVersionName);
$out = $out.Replace('$INSERTBUILDCONFIG$', $buildConfig);

if (((Get-Content $file.Input) -Join [System.Environment]::NewLine) -ne $out) {
$out | Out-File -Encoding utf8 $file.Output;
}
}
}

} finally {
$mutex.ReleaseMutex();
$mutex.Close();
@@ -41,6 +41,7 @@

<ItemGroup>
<PackageReference Include="DiffLib" Version="2017.7.26.1241" />
<PackageReference Include="Microsoft.Build.Locator" Version="1.2.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.0.0-beta4-final" />
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic" Version="3.0.0-beta4-final" />
<PackageReference Include="Microsoft.DiaSymReader.Converter.Xml" Version="1.1.0-beta1-63314-01" />
@@ -26,6 +26,7 @@
using ICSharpCode.Decompiler.CSharp;
using ICSharpCode.Decompiler.Metadata;
using ICSharpCode.Decompiler.Tests.Helpers;
using Microsoft.Build.Locator;
using Microsoft.Win32;
using NUnit.Framework;

@@ -188,22 +189,16 @@ static void ClearDirectory(string dir)
File.Delete(file);
}
}

static string FindVS2017()
{
using (var key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32)) {
using (var subkey = key.OpenSubKey(@"SOFTWARE\Microsoft\VisualStudio\SxS\VS7")) {
return subkey?.GetValue("15.0") as string;
}
}
}

static string FindMSBuild()
{
string vsPath = FindVS2017();
string vsPath = MSBuildLocator.QueryVisualStudioInstances(new VisualStudioInstanceQueryOptions { DiscoveryTypes = DiscoveryType.VisualStudioSetup })
.OrderByDescending(i => i.Version)
.FirstOrDefault()
?.MSBuildPath;
if (vsPath == null)
throw new InvalidOperationException("Could not find VS2017");
return Path.Combine(vsPath, @"MSBuild\15.0\bin\MSBuild.exe");
throw new InvalidOperationException("Could not find MSBuild");
return Path.Combine(vsPath, "msbuild.exe");
}

static void Compile(string projectFile, string outputDir)
@@ -7,7 +7,7 @@
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>

<EnableDefaultItems>false</EnableDefaultItems>
<ExtrasEnableWpfProjectSetup>true</ExtrasEnableWpfProjectSetup>
<UseWpf>true</UseWpf>
<ExtrasEnableDefaultPageItems>false</ExtrasEnableDefaultPageItems>
<ExtrasEnableDefaultResourceItems>false</ExtrasEnableDefaultResourceItems>
</PropertyGroup>
@@ -45,24 +45,19 @@
<Compile Include="BamlTestRunner.cs" />
<Compile Include="Cases\AttachedEvent.xaml.cs">
<DependentUpon>AttachedEvent.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Cases\CustomControl.cs" />
<Compile Include="Cases\MyControl.xaml.cs">
<DependentUpon>MyControl.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Cases\Resources.xaml.cs">
<DependentUpon>Resources.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Cases\Simple.xaml.cs">
<DependentUpon>Simple.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Cases\SimpleNames.xaml.cs">
<DependentUpon>SimpleNames.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Mocks\AvalonDock.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '15.0'">
<VisualStudioVersion>15.0</VisualStudioVersion>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x86">
<Configuration>Release</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|AnyCPU">
<Configuration>Debug</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|AnyCPU">
<Configuration>Release</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup>
<WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
</PropertyGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />
<PropertyGroup>
<ProjectGuid>bab51a23-9c15-42cc-8465-eb732bf9a932</ProjectGuid>
<TargetPlatformVersion>10.0.17763.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
<DefaultLanguage>en-US</DefaultLanguage>
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
<EntryPointProjectUniqueName>..\ILSpy\ILSpy.csproj</EntryPointProjectUniqueName>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppxBundle>Always</AppxBundle>
<AppxBundlePlatforms>neutral</AppxBundlePlatforms>
<UapAppxPackageBuildMode Condition="'$(ReleaseChannel)' == 'Store'">CI</UapAppxPackageBuildMode>
<AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
</PropertyGroup>
<PropertyGroup Condition="'$(ReleaseChannel)' == 'CI'">
<GenerateAppInstallerFile>true</GenerateAppInstallerFile>
<AppInstallerUri>https://some.location/tbd</AppInstallerUri>
<AppInstallerUpdateFrequency>0</AppInstallerUpdateFrequency>
<AppInstallerCheckForUpdateFrequency>OnApplicationRun</AppInstallerCheckForUpdateFrequency>
</PropertyGroup>
<ItemGroup>
<AppxManifest Include="Package-Local.appxmanifest" Condition="'$(ReleaseChannel)' == ''">
<SubType>Designer</SubType>
</AppxManifest>
<AppxManifest Include="Package-CI.appxmanifest" Condition="'$(ReleaseChannel)' == 'CI'">
<SubType>Designer</SubType>
</AppxManifest>
<AppxManifest Include="Package.appxmanifest" Condition="'$(ReleaseChannel)' == 'Store'">
<SubType>Designer</SubType>
</AppxManifest>
<None Include="*.appxmanifest" />
</ItemGroup>
<ItemGroup>
<Content Include="Images\*" />
<None Include="Package.appinstaller" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ILSpy\ILSpy.csproj" SkipGetTargetFrameworkProperties="true" />
</ItemGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
</Project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>

<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">

<Identity
Name="ICSharpCode.ILSpy.CI"
Publisher="CN=ICSharpCode"
Version="$INSERTMAJORVERSION$.$INSERTMINORVERSION$.$INSERTREVISION$.0" />

<Properties>
<DisplayName>ILSpy (CI)</DisplayName>
<PublisherDisplayName>ICSharpCode</PublisherDisplayName>
<Logo>Images\StoreLogo.png</Logo>
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.16299.0" MaxVersionTested="10.0.17763.0" />
</Dependencies>

<Resources>
<Resource Language="x-generate"/>
</Resources>

<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="ILSpy (CI)"
Description=".NET assembly inspector and decompiler"
BackgroundColor="transparent"
Square150x150Logo="Images\Square150x150Logo.png"
Square44x44Logo="Images\Square44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" Square71x71Logo="Images\SmallTile.png" Square310x310Logo="Images\LargeTile.png"/>
<uap:SplashScreen Image="Images\SplashScreen.png" />
</uap:VisualElements>

<Extensions>
<uap3:Extension Category="windows.appExecutionAlias" Executable="ILSpy\ILSpy.exe" EntryPoint="Windows.FullTrustApplication">
<uap3:AppExecutionAlias>
<desktop:ExecutionAlias Alias="ilspyc.exe" />
</uap3:AppExecutionAlias>
</uap3:Extension>
</Extensions>
</Application>
</Applications>

<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.