Skip to content

Commit b099c30

Browse files
committed
1. Added a .editorconfig file;
2. Unified formatting of different file types.
1 parent 196e5d4 commit b099c30

File tree

73 files changed

+1881
-1843
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1881
-1843
lines changed

.editorconfig

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Top-most EditorConfig file
2+
root = true
3+
4+
[*]
5+
end_of_line = crlf
6+
indent_style = tab
7+
tab_width = 4
8+
trim_trailing_whitespace = true
9+
insert_final_newline = false
10+
11+
[*.{css,less}]
12+
indent_style = space
13+
indent_size = 2
14+
15+
[*.json]
16+
indent_style = space
17+
indent_size = 2
18+
insert_final_newline = true
19+
20+
[*.{xml,config,csproj,props,targets,nuspec}]
21+
indent_style = space
22+
indent_size = 2
23+
24+
[*.sln]
25+
insert_final_newline = true
26+
27+
[*.{txt,md}]
28+
indent_style = space
29+
indent_size = unset
30+
31+
[**/{lib,build}/**]
32+
charset = unset
33+
end_of_line = unset
34+
indent_style = unset
35+
indent_size = unset
36+
trim_trailing_whitespace = unset
37+
insert_final_newline = unset

.nuget/NuGet.targets

+142-142
Original file line numberDiff line numberDiff line change
@@ -1,144 +1,144 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<PropertyGroup>
4-
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
5-
6-
<!-- Enable the restore command to run before builds -->
7-
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
8-
9-
<!-- Property that enables building a package from a project -->
10-
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
11-
12-
<!-- Determines if package restore consent is required to restore packages -->
13-
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
14-
15-
<!-- Download NuGet.exe if it does not already exist -->
16-
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
17-
</PropertyGroup>
18-
19-
<ItemGroup Condition=" '$(PackageSources)' == '' ">
20-
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
21-
<!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
22-
<!--
23-
<PackageSource Include="https://www.nuget.org/api/v2/" />
24-
<PackageSource Include="https://my-nuget-source/nuget/" />
25-
-->
26-
</ItemGroup>
27-
28-
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
29-
<!-- Windows specific commands -->
30-
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
31-
</PropertyGroup>
32-
33-
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
34-
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
35-
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
36-
</PropertyGroup>
37-
38-
<PropertyGroup>
39-
<PackagesProjectConfig Condition=" '$(OS)' == 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config</PackagesProjectConfig>
40-
<PackagesProjectConfig Condition=" '$(OS)' != 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config</PackagesProjectConfig>
41-
</PropertyGroup>
42-
43-
<PropertyGroup>
44-
<PackagesConfig Condition="Exists('$(MSBuildProjectDirectory)\packages.config')">$(MSBuildProjectDirectory)\packages.config</PackagesConfig>
45-
<PackagesConfig Condition="Exists('$(PackagesProjectConfig)')">$(PackagesProjectConfig)</PackagesConfig>
46-
</PropertyGroup>
47-
48-
<PropertyGroup>
49-
<!-- NuGet command -->
50-
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
51-
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
52-
53-
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
54-
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
55-
56-
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
57-
58-
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
59-
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
60-
61-
<PaddedSolutionDir Condition=" '$(OS)' == 'Windows_NT'">"$(SolutionDir) "</PaddedSolutionDir>
62-
<PaddedSolutionDir Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)"</PaddedSolutionDir>
63-
64-
<!-- Commands -->
65-
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand>
66-
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
67-
68-
<!-- We need to ensure packages are restored prior to assembly resolve -->
69-
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
70-
RestorePackages;
71-
$(BuildDependsOn);
72-
</BuildDependsOn>
73-
74-
<!-- Make the build depend on restore packages -->
75-
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
76-
$(BuildDependsOn);
77-
BuildPackage;
78-
</BuildDependsOn>
79-
</PropertyGroup>
80-
81-
<Target Name="CheckPrerequisites">
82-
<!-- Raise an error if we're unable to locate nuget.exe -->
83-
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
84-
<!--
85-
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
86-
This effectively acts as a lock that makes sure that the download operation will only happen once and all
87-
parallel builds will have to wait for it to complete.
88-
-->
89-
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
90-
</Target>
91-
92-
<Target Name="_DownloadNuGet">
93-
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
94-
</Target>
95-
96-
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
97-
<Exec Command="$(RestoreCommand)"
98-
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
99-
100-
<Exec Command="$(RestoreCommand)"
101-
LogStandardErrorAsError="true"
102-
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
103-
</Target>
104-
105-
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
106-
<Exec Command="$(BuildCommand)"
107-
Condition=" '$(OS)' != 'Windows_NT' " />
108-
109-
<Exec Command="$(BuildCommand)"
110-
LogStandardErrorAsError="true"
111-
Condition=" '$(OS)' == 'Windows_NT' " />
112-
</Target>
113-
114-
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
115-
<ParameterGroup>
116-
<OutputFilename ParameterType="System.String" Required="true" />
117-
</ParameterGroup>
118-
<Task>
119-
<Reference Include="System.Core" />
120-
<Using Namespace="System" />
121-
<Using Namespace="System.IO" />
122-
<Using Namespace="System.Net" />
123-
<Using Namespace="Microsoft.Build.Framework" />
124-
<Using Namespace="Microsoft.Build.Utilities" />
125-
<Code Type="Fragment" Language="cs">
126-
<![CDATA[
127-
try {
128-
OutputFilename = Path.GetFullPath(OutputFilename);
129-
130-
Log.LogMessage("Downloading latest version of NuGet.exe...");
131-
WebClient webClient = new WebClient();
132-
webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename);
133-
134-
return true;
135-
}
136-
catch (Exception ex) {
137-
Log.LogErrorFromException(ex);
138-
return false;
139-
}
140-
]]>
141-
</Code>
142-
</Task>
143-
</UsingTask>
144-
</Project>
3+
<PropertyGroup>
4+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
5+
6+
<!-- Enable the restore command to run before builds -->
7+
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
8+
9+
<!-- Property that enables building a package from a project -->
10+
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
11+
12+
<!-- Determines if package restore consent is required to restore packages -->
13+
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
14+
15+
<!-- Download NuGet.exe if it does not already exist -->
16+
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
17+
</PropertyGroup>
18+
19+
<ItemGroup Condition=" '$(PackageSources)' == '' ">
20+
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
21+
<!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
22+
<!--
23+
<PackageSource Include="https://www.nuget.org/api/v2/" />
24+
<PackageSource Include="https://my-nuget-source/nuget/" />
25+
-->
26+
</ItemGroup>
27+
28+
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
29+
<!-- Windows specific commands -->
30+
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
31+
</PropertyGroup>
32+
33+
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
34+
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
35+
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
36+
</PropertyGroup>
37+
38+
<PropertyGroup>
39+
<PackagesProjectConfig Condition=" '$(OS)' == 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config</PackagesProjectConfig>
40+
<PackagesProjectConfig Condition=" '$(OS)' != 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config</PackagesProjectConfig>
41+
</PropertyGroup>
42+
43+
<PropertyGroup>
44+
<PackagesConfig Condition="Exists('$(MSBuildProjectDirectory)\packages.config')">$(MSBuildProjectDirectory)\packages.config</PackagesConfig>
45+
<PackagesConfig Condition="Exists('$(PackagesProjectConfig)')">$(PackagesProjectConfig)</PackagesConfig>
46+
</PropertyGroup>
47+
48+
<PropertyGroup>
49+
<!-- NuGet command -->
50+
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
51+
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
52+
53+
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
54+
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
55+
56+
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
57+
58+
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
59+
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
60+
61+
<PaddedSolutionDir Condition=" '$(OS)' == 'Windows_NT'">"$(SolutionDir) "</PaddedSolutionDir>
62+
<PaddedSolutionDir Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)"</PaddedSolutionDir>
63+
64+
<!-- Commands -->
65+
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand>
66+
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
67+
68+
<!-- We need to ensure packages are restored prior to assembly resolve -->
69+
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
70+
RestorePackages;
71+
$(BuildDependsOn);
72+
</BuildDependsOn>
73+
74+
<!-- Make the build depend on restore packages -->
75+
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
76+
$(BuildDependsOn);
77+
BuildPackage;
78+
</BuildDependsOn>
79+
</PropertyGroup>
80+
81+
<Target Name="CheckPrerequisites">
82+
<!-- Raise an error if we're unable to locate nuget.exe -->
83+
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
84+
<!--
85+
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
86+
This effectively acts as a lock that makes sure that the download operation will only happen once and all
87+
parallel builds will have to wait for it to complete.
88+
-->
89+
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
90+
</Target>
91+
92+
<Target Name="_DownloadNuGet">
93+
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
94+
</Target>
95+
96+
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
97+
<Exec Command="$(RestoreCommand)"
98+
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
99+
100+
<Exec Command="$(RestoreCommand)"
101+
LogStandardErrorAsError="true"
102+
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
103+
</Target>
104+
105+
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
106+
<Exec Command="$(BuildCommand)"
107+
Condition=" '$(OS)' != 'Windows_NT' " />
108+
109+
<Exec Command="$(BuildCommand)"
110+
LogStandardErrorAsError="true"
111+
Condition=" '$(OS)' == 'Windows_NT' " />
112+
</Target>
113+
114+
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
115+
<ParameterGroup>
116+
<OutputFilename ParameterType="System.String" Required="true" />
117+
</ParameterGroup>
118+
<Task>
119+
<Reference Include="System.Core" />
120+
<Using Namespace="System" />
121+
<Using Namespace="System.IO" />
122+
<Using Namespace="System.Net" />
123+
<Using Namespace="Microsoft.Build.Framework" />
124+
<Using Namespace="Microsoft.Build.Utilities" />
125+
<Code Type="Fragment" Language="cs">
126+
<![CDATA[
127+
try {
128+
OutputFilename = Path.GetFullPath(OutputFilename);
129+
130+
Log.LogMessage("Downloading latest version of NuGet.exe...");
131+
WebClient webClient = new WebClient();
132+
webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename);
133+
134+
return true;
135+
}
136+
catch (Exception ex) {
137+
Log.LogErrorFromException(ex);
138+
return false;
139+
}
140+
]]>
141+
</Code>
142+
</Task>
143+
</UsingTask>
144+
</Project>

JavaScriptEngineSwitcher.NoSamples.sln

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27130.2010
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.29613.14
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{19575E10-6B8E-4CF0-B7D2-898FFF47E157}"
77
ProjectSection(SolutionItems) = preProject
8+
.editorconfig = .editorconfig
89
CHANGELOG.md = CHANGELOG.md
910
global.json = global.json
1011
LICENSE.txt = LICENSE.txt

JavaScriptEngineSwitcher.sln

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27130.2010
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.29613.14
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{19575E10-6B8E-4CF0-B7D2-898FFF47E157}"
77
ProjectSection(SolutionItems) = preProject
8+
.editorconfig = .editorconfig
89
CHANGELOG.md = CHANGELOG.md
910
global.json = global.json
1011
LICENSE.txt = LICENSE.txt

build/common.props

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<Project>
2-
<PropertyGroup>
3-
<Copyright>Copyright © 2013-2019 Andrey Taritsyn</Copyright>
4-
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
5-
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
6-
</PropertyGroup>
2+
<PropertyGroup>
3+
<Copyright>Copyright © 2013-2019 Andrey Taritsyn</Copyright>
4+
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
5+
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
6+
</PropertyGroup>
77

8-
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40-client' Or '$(TargetFramework)' == 'net45' Or '$(TargetFramework)' == 'net451' Or '$(TargetFramework)' == 'net452' Or '$(TargetFramework)' == 'net46' Or '$(TargetFramework)' == 'net471' ">
9-
<DefineConstants>$(DefineConstants);NETFULL</DefineConstants>
10-
</PropertyGroup>
8+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40-client' Or '$(TargetFramework)' == 'net45' Or '$(TargetFramework)' == 'net451' Or '$(TargetFramework)' == 'net452' Or '$(TargetFramework)' == 'net46' Or '$(TargetFramework)' == 'net471' ">
9+
<DefineConstants>$(DefineConstants);NETFULL</DefineConstants>
10+
</PropertyGroup>
1111

12-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' Or '$(TargetFramework)' == 'netstandard1.6' Or '$(TargetFramework)' == 'netstandard2.0' ">
13-
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
14-
</PropertyGroup>
12+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' Or '$(TargetFramework)' == 'netstandard1.6' Or '$(TargetFramework)' == 'netstandard2.0' ">
13+
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
14+
</PropertyGroup>
1515

16-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' Or '$(TargetFramework)' == 'netcoreapp2.0' Or '$(TargetFramework)' == 'netcoreapp2.1' ">
17-
<DefineConstants>$(DefineConstants);NETCOREAPP</DefineConstants>
18-
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' Or '$(TargetFramework)' == 'netcoreapp2.0' Or '$(TargetFramework)' == 'netcoreapp2.1' ">
17+
<DefineConstants>$(DefineConstants);NETCOREAPP</DefineConstants>
18+
</PropertyGroup>
1919
</Project>

0 commit comments

Comments
 (0)