Skip to content
This repository was archived by the owner on Jul 28, 2021. It is now read-only.

Commit d6e22a1

Browse files
authored
🚀 Modernizing AppVeyor and NuGet package. (#42)
1 parent 1951ff6 commit d6e22a1

File tree

8 files changed

+300
-98
lines changed

8 files changed

+300
-98
lines changed

‎.editorconfig‎

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# EditorConfig is awesome:
2+
http://EditorConfig.org
3+
4+
5+
#### How to manually clean up code in an IDE?
6+
7+
#### - Visual Studio: CTRL + K + D
8+
#### - VSCode: SHIFT + ALT + F
9+
10+
11+
12+
####################################################################################################
13+
14+
### VS Settings Reference: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
15+
16+
17+
18+
19+
# top-most EditorConfig file
20+
root = true
21+
22+
# Default settings:
23+
# A newline ending every file
24+
# Use 4 spaces as indentation
25+
[*]
26+
insert_final_newline = true
27+
indent_style = space
28+
indent_size = 4
29+
end_of_line = crlf
30+
charset = utf-8
31+
32+
# C# files
33+
[*.cs]
34+
# New line preferences
35+
csharp_new_line_before_open_brace = all
36+
csharp_new_line_before_else = true
37+
csharp_new_line_before_catch = true
38+
csharp_new_line_before_finally = true
39+
csharp_new_line_before_members_in_object_initializers = true
40+
csharp_new_line_before_members_in_anonymous_types = true
41+
csharp_new_line_between_query_expression_clauses = true
42+
43+
# Indentation preferences
44+
csharp_indent_block_contents = true
45+
csharp_indent_braces = false
46+
csharp_indent_case_contents = true
47+
csharp_indent_switch_labels = true
48+
csharp_indent_labels = one_less_than_current
49+
50+
# avoid this. unless absolutely necessary
51+
dotnet_style_qualification_for_field = false:suggestion
52+
dotnet_style_qualification_for_property = false:suggestion
53+
dotnet_style_qualification_for_method = false:suggestion
54+
dotnet_style_qualification_for_event = false:suggestion
55+
56+
# only use var when it's obvious what the variable type is
57+
csharp_style_var_for_built_in_types = true:suggestion
58+
csharp_style_var_when_type_is_apparent = true:suggestion
59+
csharp_style_var_elsewhere = true:suggestion
60+
61+
# use language keywords instead of BCL types
62+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
63+
dotnet_style_predefined_type_for_member_access = true:suggestion
64+
65+
# name all constant fields using PascalCase
66+
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
67+
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
68+
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
69+
70+
dotnet_naming_symbols.constant_fields.applicable_kinds = field
71+
dotnet_naming_symbols.constant_fields.required_modifiers = const
72+
73+
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
74+
75+
# static fields should have s_ prefix
76+
dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
77+
dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
78+
dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
79+
80+
dotnet_naming_symbols.static_fields.applicable_kinds = field
81+
dotnet_naming_symbols.static_fields.required_modifiers = static
82+
83+
dotnet_naming_style.static_prefix_style.required_prefix = s_
84+
dotnet_naming_style.static_prefix_style.capitalization = camel_case
85+
86+
# internal and private fields should be _camelCase
87+
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
88+
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
89+
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
90+
91+
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
92+
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
93+
94+
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
95+
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
96+
97+
# Code style defaults
98+
dotnet_sort_system_directives_first = true
99+
csharp_preserve_single_line_blocks = true
100+
csharp_preserve_single_line_statements = false
101+
102+
# Expression-level preferences
103+
dotnet_style_object_initializer = true:suggestion
104+
dotnet_style_collection_initializer = true:suggestion
105+
dotnet_style_explicit_tuple_names = true:suggestion
106+
dotnet_style_coalesce_expression = true:suggestion
107+
dotnet_style_null_propagation = true:suggestion
108+
109+
# Expression-bodied members
110+
csharp_style_expression_bodied_methods = false:none
111+
csharp_style_expression_bodied_constructors = false:none
112+
csharp_style_expression_bodied_operators = false:none
113+
csharp_style_expression_bodied_properties = true:none
114+
csharp_style_expression_bodied_indexers = true:none
115+
csharp_style_expression_bodied_accessors = true:none
116+
117+
# Pattern matching
118+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
119+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
120+
csharp_style_inlined_variable_declaration = true:suggestion
121+
122+
# Null checking preferences
123+
csharp_style_throw_expression = true:suggestion
124+
csharp_style_conditional_delegate_call = true:suggestion
125+
126+
# Space preferences
127+
csharp_space_after_cast = false
128+
csharp_space_after_colon_in_inheritance_clause = true
129+
csharp_space_after_comma = true
130+
csharp_space_after_dot = false
131+
csharp_space_after_keywords_in_control_flow_statements = true
132+
csharp_space_after_semicolon_in_for_statement = true
133+
csharp_space_around_binary_operators = before_and_after
134+
csharp_space_around_declaration_statements = do_not_ignore
135+
csharp_space_before_colon_in_inheritance_clause = true
136+
csharp_space_before_comma = false
137+
csharp_space_before_dot = false
138+
csharp_space_before_open_square_brackets = false
139+
csharp_space_before_semicolon_in_for_statement = false
140+
csharp_space_between_empty_square_brackets = false
141+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
142+
csharp_space_between_method_call_name_and_opening_parenthesis = false
143+
csharp_space_between_method_call_parameter_list_parentheses = false
144+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
145+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
146+
csharp_space_between_method_declaration_parameter_list_parentheses = false
147+
csharp_space_between_parentheses = false
148+
csharp_space_between_square_brackets = false
149+
150+
[*.{asm,inc}]
151+
indent_size = 8
152+
153+
# Xml project files
154+
[*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
155+
indent_size = 2
156+
157+
# Xml config files
158+
[*.{props,targets,config,nuspec}]
159+
indent_size = 2
160+
161+
[CMakeLists.txt]
162+
indent_size = 2
163+
164+
[*.cmd]
165+
indent_size = 2

‎appveyor.yml‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11

22
version: '{build}.0.0-dev'
33
configuration: Release
4-
os: Visual Studio 2017
4+
os: Visual Studio 2019
55
pull_requests:
66
do_not_increment_build_number: true
77

8-
environment:
9-
nuget_apiKey:
10-
secure: jfcUvHZhgnUboplqTBDWr8mG5PIlrgBv5TA2fhhop4ZSiDxskyy+RtYyeHoduJFR
11-
myget_apiKey:
12-
secure: AguzfXNvHBkkDebTyWHK7o9OC5YL3eszT6u7PnzGq2G7ozdUypDlGGpcFsTRYHEc
8+
branches:
9+
only:
10+
- master
1311

1412
# Override the 'version' if this is a GH-tag-commit -or- this is a custom branch (i.e not 'master').
1513
init:
@@ -21,42 +19,44 @@ init:
2119
}
2220
iex ((new-object net.webclient).DownloadString('https://gist.githubusercontent.com/PureKrome/0f79e25693d574807939/raw/f5b40256fc2ca77d49f1c7773d28406152544c1e/appveyor-build-info.ps'))
2321
22+
install:
23+
# For .NET50
24+
- sh: curl -sSL https://dot.net/v1/dotnet-install.sh | sudo bash /dev/stdin --channel 5.0 --version 5.0.100 --install-dir /usr/share/dotnet
2425

2526
before_build:
2627
# Display .NET Core version
27-
- cmd: dotnet --info
28-
# Display minimal restore text
29-
- cmd: dotnet restore --verbosity quiet
28+
- dotnet --info
3029

3130
build_script:
32-
- dotnet build -c %CONFIGURATION% -v minimal /p:Version=%APPVEYOR_BUILD_VERSION% --no-restore
31+
- dotnet restore --verbosity quiet
32+
- ps: dotnet build -c $env:CONFIGURATION -v minimal /p:Version=$env:APPVEYOR_BUILD_VERSION --no-restore
3333

3434
test_script:
35-
- dotnet test tests\Yahoo.Yui.Compressor.Tests -c %CONFIGURATION% -v minimal --no-restore --no-build
36-
- dotnet pack -c %CONFIGURATION% /p:Version=%APPVEYOR_BUILD_VERSION% --no-restore --no-build
35+
- ps: dotnet test -c $env:CONFIGURATION -v minimal --no-build
36+
37+
after_test:
38+
- ps: dotnet pack -c $env:CONFIGURATION --no-build /p:Version=$env:APPVEYOR_BUILD_VERSION /p:ContinuousIntegrationBuild=true
3739

3840
artifacts:
3941
- path: '**\*.nupkg'
40-
name: packaged-nugets
42+
name: nuget-packages
43+
type: NuGetPackage
44+
- path: '**\*.snupkg'
45+
name: nuget-symbols
4146
type: NuGetPackage
4247

4348
deploy:
4449
- provider: NuGet
4550
server: https://www.myget.org/F/pk-development/api/v2/package
4651
api_key:
4752
secure: AguzfXNvHBkkDebTyWHK7o9OC5YL3eszT6u7PnzGq2G7ozdUypDlGGpcFsTRYHEc
48-
skip_symbols: true
49-
artifact: packaged-nugets
53+
artifact: nuget-packages
5054
on:
5155
appveyor_repo_tag: false
5256
- provider: NuGet
5357
api_key:
54-
secure: jfcUvHZhgnUboplqTBDWr8mG5PIlrgBv5TA2fhhop4ZSiDxskyy+RtYyeHoduJFR
55-
skip_symbols: true
56-
artifact: packaged-nugets
58+
secure: 8EdmbIQFKJXCePp1LFPdA0QoocIaXmLeJeU3LNbvrQ5iROs9hBdKu+3n+94ndxj1
59+
artifact: nuget-packages
5760
on:
5861
branch: master
5962
appveyor_repo_tag: true
60-
61-
cache:
62-
- packages -> **\packages.config

‎global.json‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"version": "5.0.100",
4+
"rollForward": "latestFeature"
5+
}
6+
}

‎icon.jpg‎

10.2 KB
Loading
Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,57 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
55
<PackageId>YUICompressor.NET</PackageId>
6-
<Version>0.0.0</Version>
76
<Authors>Pure Krome and freeranger</Authors>
87
<Company>World-Domination Technologies Pty. Ltd.</Company>
98
<Product>YUICompressor.NET</Product>
9+
<Description>
10+
This library can minify and/or bundle any Javascript and/or Cascading Style Sheets.
11+
12+
This is a direct .NET port of the original Yahoo! UI Library: YUI Compressor.
13+
</Description>
1014
<Summary>Minify and/or Combine JavaScript and/or Cascading Style Sheets.</Summary>
11-
<Description>This library can minify and/or bundle any Javascript and/or Cascading Style Sheets.
12-
13-
This is a direct .NET port of the original Yahoo! UI Library: YUI Compressor.</Description>
1415
<Copyright>2008</Copyright>
15-
<PackageLicenseUrl>https://github.com/YUICompressor-NET/YUICompressor.NET/blob/master/LICENSE.txt</PackageLicenseUrl>
16+
<OutputType>Library</OutputType>
1617
<PackageProjectUrl>https://github.com/YUICompressor-NET/YUICompressor.NET</PackageProjectUrl>
17-
<PackageIconUrl>http://i.imgur.com/bR4Yf.jpg</PackageIconUrl>
18+
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
1819
<RepositoryUrl>https://github.com/YUICompressor-NET/YUICompressor.NET</RepositoryUrl>
19-
<RepositoryType>.NET C#</RepositoryType>
20+
<RepositoryType>.net c# .net-core</RepositoryType>
2021
<PackageTags>compression compressor minification obfuscation minify bundle bundler combine javascript js CSS cascading-style-sheets</PackageTags>
22+
<PackageReleaseNotes></PackageReleaseNotes>
23+
24+
<IsPackable>true</IsPackable>
25+
26+
<!-- Source Link. REF: https://github.com/dotnet/sourcelink -->
27+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
28+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
29+
<IncludeSymbols>true</IncludeSymbols>
30+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
31+
<PackageIcon>icon.jpg</PackageIcon>
32+
<PackageIconUrl />
33+
34+
35+
2136
</PropertyGroup>
2237

2338
<ItemGroup>
2439
<PackageReference Include="EcmaScript.NET" Version="2.0.0" />
40+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
41+
<PrivateAssets>all</PrivateAssets>
42+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
43+
</PackageReference>
2544
</ItemGroup>
2645

46+
<ItemGroup>
47+
<None Include="..\..\LICENSE.txt">
48+
<Pack>True</Pack>
49+
<PackagePath></PackagePath>
50+
</None>
51+
<None Include="..\..\icon.jpg">
52+
<Pack>True</Pack>
53+
<PackagePath></PackagePath>
54+
</None>
55+
</ItemGroup>
56+
2757
</Project>

‎tests/Yahoo.Yui.Compressor.Tests/CompatabilityTests.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Generic;
22
using System.Diagnostics;
33
using System.IO;
44
using System.Text;
@@ -70,7 +70,7 @@ private void ExecuteFileTests(ICompressor compressor, string extension, List<str
7070
// Since we don't have linq in .net 2 land :}
7171
for (var i = 0; i < exclusions.Count; i++)
7272
{
73-
exclusions[i] = "Compatability Test Files\\" + exclusions[i] + extension;
73+
exclusions[i] = Path.Combine("Compatability Test Files", exclusions[i] + extension);
7474
}
7575

7676
var sourceFiles = Directory.GetFiles("Compatability Test Files", "*" + extension);

0 commit comments

Comments
 (0)