Skip to content

Commit 688eb37

Browse files
committed
New build system
1 parent 974247b commit 688eb37

File tree

66 files changed

+741
-52574
lines changed

Some content is hidden

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

66 files changed

+741
-52574
lines changed

.github/workflows/ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# ------------------------------------------------------------------------------
2+
# <auto-generated>
3+
#
4+
# This code was generated.
5+
#
6+
# - To turn off auto-generation set:
7+
#
8+
# [GitHubActions (AutoGenerate = false)]
9+
#
10+
# - To trigger manual generation invoke:
11+
#
12+
# nuke --generate-configuration GitHubActions_ci --host GitHubActions
13+
#
14+
# </auto-generated>
15+
# ------------------------------------------------------------------------------
16+
17+
name: ci
18+
19+
on:
20+
push:
21+
branches:
22+
- main
23+
- master
24+
pull_request:
25+
branches:
26+
- main
27+
- master
28+
29+
jobs:
30+
windows-latest:
31+
name: windows-latest
32+
runs-on: windows-latest
33+
steps:
34+
- uses: actions/checkout@v1
35+
- name: Cache .nuke/temp, ~/.nuget/packages
36+
uses: actions/cache@v2
37+
with:
38+
path: |
39+
.nuke/temp
40+
~/.nuget/packages
41+
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
42+
- name: Run './Build.cmd Ci'
43+
run: ./Build.cmd Ci
44+
env:
45+
TODO: ${{ secrets.TODO }}

.github/workflows/publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
env:
13+
DOTNET_NOLOGO: true
14+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
15+
16+
steps:
17+
- name: Checkout source code
18+
uses: actions/checkout@v2
19+
20+
- name: Setup dotnet 2.1
21+
uses: actions/setup-dotnet@v1
22+
with:
23+
dotnet-version: 2.1.*
24+
25+
- name: Setup dotnet 3.1
26+
uses: actions/setup-dotnet@v1
27+
with:
28+
dotnet-version: 3.1.*
29+
30+
- name: Setup dotnet 5.0
31+
uses: actions/setup-dotnet@v1
32+
with:
33+
dotnet-version: 5.0.*
34+
35+
- name: Test
36+
run: dotnet test --configuration Release
37+
38+
- name: Pack with dotnet
39+
run: |
40+
arrTag=(${GITHUB_REF//\// })
41+
VERSION="${arrTag[2]}"
42+
VERSION="${VERSION//v}"
43+
echo "$VERSION"
44+
dotnet pack --output artifacts --configuration Release -p:Version=$VERSION
45+
46+
- name: Push with dotnet
47+
run: dotnet nuget push artifacts/*.*nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,4 @@ PrecompiledWeb
8787
project.lock.json
8888

8989
BenchmarkDotNet.Artifacts*
90+
/artifacts

.nuke/build.schema.json

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"title": "Build Schema",
4+
"$ref": "#/definitions/build",
5+
"definitions": {
6+
"build": {
7+
"type": "object",
8+
"properties": {
9+
"BuildEms": {
10+
"type": "boolean",
11+
"description": "Build EMS"
12+
},
13+
"Configuration": {
14+
"type": "string",
15+
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
16+
"enum": [
17+
"Debug",
18+
"Release"
19+
]
20+
},
21+
"Continue": {
22+
"type": "boolean",
23+
"description": "Indicates to continue a previously failed build attempt"
24+
},
25+
"GitHubRegistryApiKey": {
26+
"type": "string",
27+
"default": "Secrets must be entered via 'nuke :secret [profile]'"
28+
},
29+
"Help": {
30+
"type": "boolean",
31+
"description": "Shows the help text for this build assembly"
32+
},
33+
"Host": {
34+
"type": "string",
35+
"description": "Host for execution. Default is 'automatic'",
36+
"enum": [
37+
"AppVeyor",
38+
"AzurePipelines",
39+
"Bamboo",
40+
"Bitrise",
41+
"GitHubActions",
42+
"GitLab",
43+
"Jenkins",
44+
"SpaceAutomation",
45+
"TeamCity",
46+
"Terminal",
47+
"TravisCI"
48+
]
49+
},
50+
"NoLogo": {
51+
"type": "boolean",
52+
"description": "Disables displaying the NUKE logo"
53+
},
54+
"Plan": {
55+
"type": "boolean",
56+
"description": "Shows the execution plan (HTML)"
57+
},
58+
"Profile": {
59+
"type": "array",
60+
"description": "Defines the profiles to load",
61+
"items": {
62+
"type": "string"
63+
}
64+
},
65+
"ProjectVersion": {
66+
"type": "string",
67+
"description": "Version"
68+
},
69+
"PublicNuGetApiKey": {
70+
"type": "string",
71+
"default": "Secrets must be entered via 'nuke :secret [profile]'"
72+
},
73+
"Root": {
74+
"type": "string",
75+
"description": "Root directory during build execution"
76+
},
77+
"Skip": {
78+
"type": "array",
79+
"description": "List of targets to be skipped. Empty list skips all dependencies",
80+
"items": {
81+
"type": "string",
82+
"enum": [
83+
"Ci",
84+
"Clean",
85+
"Compile",
86+
"Pack",
87+
"Restore",
88+
"Test"
89+
]
90+
}
91+
},
92+
"Solution": {
93+
"type": "string",
94+
"description": "Path to a solution file that is automatically loaded"
95+
},
96+
"Target": {
97+
"type": "array",
98+
"description": "List of targets to be invoked. Default is '{default_target}'",
99+
"items": {
100+
"type": "string",
101+
"enum": [
102+
"Ci",
103+
"Clean",
104+
"Compile",
105+
"Pack",
106+
"Restore",
107+
"Test"
108+
]
109+
}
110+
},
111+
"TestFull": {
112+
"type": "boolean"
113+
},
114+
"TestIntegrationData": {
115+
"type": "boolean"
116+
},
117+
"TestIntegrationEms": {
118+
"type": "boolean"
119+
},
120+
"TestIntegrationMsMq": {
121+
"type": "boolean"
122+
},
123+
"TestIntegrationNms": {
124+
"type": "boolean"
125+
},
126+
"Verbosity": {
127+
"type": "string",
128+
"description": "Logging verbosity during build execution. Default is 'Normal'",
129+
"enum": [
130+
"Minimal",
131+
"Normal",
132+
"Quiet",
133+
"Verbose"
134+
]
135+
}
136+
}
137+
}
138+
}
139+
}

.nuke/parameters.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "./build.schema.json",
3+
"Solution": "Spring.Net.sln"
4+
}

Build.cmd

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,7 @@
1-
@echo off
2-
cd build-support
3-
call set-nant-config-per-processor-architecture.cmd
4-
cd ..
5-
@echo .
6-
@echo ..
7-
@echo ...
8-
@echo Running full Build Script, capturing output to buildlog.txt file...
9-
@echo Start Time: %time%
10-
build-support\tools\nant\bin\nant -D:test.withcoverage=false %1 %2 %3 %4 %5 %6 %7 %8 %9 > buildlog.txt
11-
@echo .
12-
@echo ..
13-
@echo ...
14-
@echo Launching text file viewer to display buildlog.txt contents...
15-
start "ignored but required placeholder window title argument" buildlog.txt
16-
@echo .
17-
@echo ..
18-
@echo ...
19-
@echo ************************
20-
@echo Build Complete!
21-
@echo ************************
22-
@echo End Time: %time%
23-
@echo   
1+
:; set -eo pipefail
2+
:; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
3+
:; ${SCRIPT_DIR}/build.sh "$@"
4+
:; exit $?
5+
6+
@ECHO OFF
7+
powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %*

README.md

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -166,29 +166,7 @@ Documented sample applications can be found in "examples":
166166
VS.NET
167167
------
168168

169-
Visual Studio 2017 is required to open and build the solution. The free community version of Visual Studio should suffice.
170-
171-
For the first time you need to execute `Build.cmd` which will generate `GenCommonAssemblyInfo.cs` file required for builds.
172-
173-
NAnt
174-
----
175-
176-
Build scripts are delivered with the download package.
177-
178-
To build the source and run the unit tests type
179-
180-
build test
181-
182-
If you want to run the build to create strongly signed assemblies you can generate a key file by executing the following command (assuming that sn.exe is properly on your search path):
183-
184-
sn -k Spring.Net.snk
185-
186-
You need to place the Spring.NET.snk file into the root folder of the source tree. All builds are strongly named using this key file when executing the following nant command:
187-
188-
nant -D:project.build.sign=true
189-
190-
InnovaSys Document X! is used to generate the SDK documentation.
191-
169+
Visual Studio 2019 is required to open and build the solution. The free community version of Visual Studio should suffice.
192170

193171
## 8. Support
194172

Spring.Net.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1212
Spring.build = Spring.build
1313
Spring.include = Spring.include
1414
README.md = README.md
15+
src\Directory.Build.props = src\Directory.Build.props
1516
EndProjectSection
1617
EndProject
1718
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{79F495DF-83D6-435E-A20E-47800F6F8FE7}"
@@ -99,6 +100,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Benchmark", "test\Sp
99100
EndProject
100101
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{9537C677-ADE5-4503-AFD7-3E0C3B0960EB}"
101102
EndProject
103+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "build-support\nuke-build\_build.csproj", "{0D135B50-2B59-44C1-941A-32B5EC798C88}"
104+
EndProject
102105
Global
103106
GlobalSection(SolutionConfigurationPlatforms) = preSolution
104107
Debug|.NET = Debug|.NET
@@ -109,6 +112,10 @@ Global
109112
Release|Mixed Platforms = Release|Mixed Platforms
110113
EndGlobalSection
111114
GlobalSection(ProjectConfigurationPlatforms) = postSolution
115+
{0D135B50-2B59-44C1-941A-32B5EC798C88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
116+
{0D135B50-2B59-44C1-941A-32B5EC798C88}.Release|Any CPU.ActiveCfg = Release|Any CPU
117+
{0D135B50-2B59-44C1-941A-32B5EC798C88}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
118+
{0D135B50-2B59-44C1-941A-32B5EC798C88}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
112119
{710961A3-0DF4-49E4-A26E-F5B9C044AC84}.Debug|.NET.ActiveCfg = Debug|Any CPU
113120
{710961A3-0DF4-49E4-A26E-F5B9C044AC84}.Debug|.NET.Build.0 = Debug|Any CPU
114121
{710961A3-0DF4-49E4-A26E-F5B9C044AC84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[*.cs]
2+
dotnet_style_qualification_for_field = false:warning
3+
dotnet_style_qualification_for_property = false:warning
4+
dotnet_style_qualification_for_method = false:warning
5+
dotnet_style_qualification_for_event = false:warning
6+
dotnet_style_require_accessibility_modifiers = never:warning
7+
8+
csharp_style_expression_bodied_methods = true:silent
9+
csharp_style_expression_bodied_properties = true:warning
10+
csharp_style_expression_bodied_indexers = true:warning
11+
csharp_style_expression_bodied_accessors = true:warning
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Nuke.Common;
2+
using Nuke.Common.CI.GitHubActions;
3+
4+
[GitHubActions(
5+
name: "ci",
6+
//GitHubActionsImage.UbuntuLatest,
7+
GitHubActionsImage.WindowsLatest,
8+
AutoGenerate = true,
9+
OnPushBranches = new[] {"main", "master"},
10+
OnPullRequestBranches = new[] {"main", "master"},
11+
InvokedTargets = new[] {nameof(Ci)},
12+
ImportSecrets = new[] {"TODO"},
13+
PublishArtifacts = true
14+
)]
15+
public partial class Build
16+
{
17+
Target Ci => _ => _
18+
.DependsOn(Test, Pack)
19+
.Executes();
20+
}

0 commit comments

Comments
 (0)