Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
tools/
*.nupkg

#################
## Eclipse
#################
Expand Down
8 changes: 4 additions & 4 deletions CSharpMinifier.GUI/App.config
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="CSharpMinifier.GUI.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
<section name="CSharpMinifier.GUI.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
</startup>
<userSettings>
<CSharpMinifier.GUI.Properties.Settings>
Expand Down
21 changes: 12 additions & 9 deletions CSharpMinifier.GUI/CSharpMinifier.GUI.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand All @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CSharpMinifier.GUI</RootNamespace>
<AssemblyName>CSharpMinifier.GUI</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
Expand All @@ -35,6 +35,9 @@
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down Expand Up @@ -76,20 +79,20 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CSharpMinifier\CSharpMinifier.csproj">
<Project>{a26c936c-846b-4165-9574-42c74075d4cd}</Project>
<Name>CSharpMinifier</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Error.png" />
</ItemGroup>
<ItemGroup>
<None Include="Ok.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CSharpMinifier\CSharpMinifier.csproj">
<Project>{a26c936c-846b-4165-9574-42c74075d4cd}</Project>
<Name>CSharpMinifier</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
Expand Down
4 changes: 2 additions & 2 deletions CSharpMinifier.GUI/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion CSharpMinifier.GUI/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions CSharpMinifier.GUI/frmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,14 @@ private void btnMinify_Click(object sender, EventArgs e)
EnumToIntConversion = cbEnumToIntConversion.Checked,
Unsafe = cbUnsafe.Checked
};
Minifier minifier = new Minifier(minifierOptions);
IMinifier minifier = new RoslynMinifier(minifierOptions);
tbOutput.Text = !cbMinifyFiles.Checked ? minifier.MinifyFromString(tbInput.Text) : minifier.MinifyFiles(Sources.Select(source => source.Value).ToArray());

tbInputLength.Text = tbInput.Text.Length.ToString();
tbOutputLength.Text = tbOutput.Text.Length.ToString();
tbOutputInputRatio.Text = ((double)tbOutput.Text.Length / tbInput.Text.Length).ToString("0.000000");
var compileResult = CompileUtils.Compile(tbOutput.Text);
var cscPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "..", "tools", "Microsoft.Net.Compilers", "tools", "csc.exe");
var compileResult = CompileUtils.Compile(tbOutput.Text, cscPath);
dgvErrors.Rows.Clear();
if (!compileResult.Errors.HasErrors)
{
Expand Down
93 changes: 30 additions & 63 deletions CSharpMinifier.Tests/CSharpMinifier.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,75 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{24A6BB34-4BE9-4504-926D-16D52FE5AC41}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CSharpMinifier.Tests</RootNamespace>
<AssemblyName>CSharpMinifier.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<TargetFramework>netcoreapp2.1</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Compile Remove="Samples\EnumToIntConversion.cs" />
<Compile Remove="Samples\Minecraft19.cs" />
<Compile Remove="Samples\Minecraft20.cs" />
<Compile Remove="Samples\MiscCompression.cs" />
<Compile Remove="Samples\RLE.cs" />
<Compile Remove="Samples\Test1.cs" />
<Compile Remove="Samples\Test2.cs" />
</ItemGroup>

<ItemGroup>
<Compile Include="IdGeneratorTests.cs" />
<Compile Include="MinifierTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Samples\EnumToIntConversion.cs" />
<Compile Include="Samples\Minecraft19.cs" />
<Compile Include="Samples\Minecraft20.cs" />
<Compile Include="Samples\MiscCompression.cs" />
<Compile Include="Samples\RLE.cs" />
<Compile Include="Samples\Test1.cs" />
<Compile Include="Samples\Test2.cs" />
<Content Include="Samples\EnumToIntConversion.cs" />
<Content Include="Samples\Minecraft19.cs" />
<Content Include="Samples\Minecraft20.cs" />
<Content Include="Samples\MiscCompression.cs" />
<Content Include="Samples\RLE.cs" />
<Content Include="Samples\Test1.cs" />
<Content Include="Samples\Test2.cs" />
</ItemGroup>

<ItemGroup>
<None Include="packages.config" />
<PackageReference Include="nunit" Version="3.11.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CSharpMinifier\CSharpMinifier.csproj">
<Project>{a26c936c-846b-4165-9574-42c74075d4cd}</Project>
<Name>CSharpMinifier</Name>
</ProjectReference>
<ProjectReference Include="..\CSharpMinifier\CSharpMinifier.csproj" />
</ItemGroup>

<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
<Folder Include="Properties\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

</Project>
32 changes: 0 additions & 32 deletions CSharpMinifier.Tests/IdGeneratorTests.cs

This file was deleted.

Loading