makit 0.0.126 → 0.0.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/makit/setup/classlib.rb +37 -33
- data/lib/makit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15584e2a283563b4b5dedc1f44ee95f7ecce6dc9bb906764726181c4b10c3e49
|
4
|
+
data.tar.gz: ddb61c19e66718669ebea95d0246f885dc9767f49db82ecc4331234159bd900d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b884215dea782f28428386e4b540a8d2d1443c371ddbd45ee333eb9b6dd70fe3ecbc192bcf2ecffcd232a2e4c52667902be6b871043ca3a7c9fbffd4f586c069
|
7
|
+
data.tar.gz: bee457e60325c56c67f5d40e1c17f4d28bbffc27b0079b4bcd225229e3176066284c88e0546c40512c73c8a80fbe69416487b2f286918aecb493cc5c677a6395
|
data/lib/makit/setup/classlib.rb
CHANGED
@@ -8,37 +8,47 @@ module Makit
|
|
8
8
|
def self.run
|
9
9
|
# puts "Setting up Nuget project..."
|
10
10
|
project = Makit::Configuration::Project.default
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
11
|
+
|
12
|
+
project_filename = "source/#{project.name}/#{project.name}.csproj"
|
13
|
+
if (!File.exist?(project_filename))
|
14
|
+
Makit::DotNet::Project.new_project("classlib", project.name, "source/#{project.name}", "--framework net8.0")
|
15
|
+
dotnet_project = Makit::DotNet::Project.new("source/#{project.name}/#{project.name}.csproj")
|
16
|
+
# set the version to project.version
|
17
|
+
dotnet_project.set_version(project.version)
|
18
|
+
# set the frameworks = ["net8.0","net8.0-browser"]
|
19
|
+
dotnet_project.set_target_frameworks(["net8.0", "net8.0-browser"])
|
20
|
+
# set the nuget metadata
|
21
|
+
dotnet_project.set_nuget_metadata(project.name, project.authors, project.description,
|
22
|
+
project.license_expression)
|
23
|
+
end
|
24
|
+
|
25
|
+
test_project_filename = "tests/#{project.name}.Tests/#{project.name}.Tests.csproj"
|
26
|
+
if (File.exist?(test_project_filename))
|
27
|
+
Makit::DotNet::Project.new_project("TUnit", "#{project.name}.Tests", "tests/#{project.name}.Tests")
|
28
|
+
dotnet_project = Makit::DotNet::Project.new("tests/#{project.name}.Tests/#{project.name}.Tests.csproj")
|
29
|
+
# set the version to project.version
|
30
|
+
dotnet_project.set_version(project.version)
|
31
|
+
# set the frameworks = ["net8.0","net8.0-browser"]
|
32
|
+
dotnet_project.set_target_frameworks(["net8.0"])
|
33
|
+
# set the nuget metadata
|
34
|
+
dotnet_project.set_nuget_metadata("#{project.name}.Tests", project.authors, project.description,
|
35
|
+
project.license_expression)
|
36
|
+
Makit::DotNet::Project.add_reference("tests/#{project.name}/#{project.name}.Tests.csproj",
|
37
|
+
"source/#{project.name}/#{project.name}.csproj")
|
38
|
+
end
|
31
39
|
update_build_step(project)
|
32
40
|
update_test_step(project)
|
33
41
|
|
34
42
|
project.save
|
35
43
|
|
36
44
|
# Setup the sln, then slnx
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
45
|
+
if (!File.exist?("#{project.name}.slnx"))
|
46
|
+
Makit::DotNet.new_solution(project.name)
|
47
|
+
Makit::DotNet.sln_add_projects(project.name)
|
48
|
+
# migrate the sln to slnx
|
49
|
+
"dotnet sln migrate #{project.name}.sln".run
|
50
|
+
FileUtils.rm_f("#{project.name}.sln") if File.exist?("#{project.name}.slnx")
|
51
|
+
end
|
42
52
|
Makit::Logging.default_logger.debug("Project setup completed")
|
43
53
|
end
|
44
54
|
|
@@ -46,15 +56,9 @@ module Makit
|
|
46
56
|
build_commands = []
|
47
57
|
build_commands << "dotnet restore #{project.name}.slnx" if File.exist?("#{project.name}.slnx")
|
48
58
|
build_commands << "dotnet build source/#{project.name}/#{project.name}.csproj --configuration Release"
|
49
|
-
build_commands << "dotnet build tests/#{project.name}/#{project.name}.Tests.csproj --configuration Release"
|
59
|
+
build_commands << "dotnet build tests/#{project.name}.Tests/#{project.name}.Tests.csproj --configuration Release"
|
50
60
|
build_commands << "dotnet pack source/#{project.name}/#{project.name}.csproj --configuration Release --output artifacts/Packages"
|
51
|
-
build_commands << "dotnet pack tests/#{project.name}/#{project.name}.Tests.csproj --configuration Release --output artifacts/Packages"
|
52
|
-
if File.exist?("source/#{project.name}.Pages/#{project.name}.Pages.csproj")
|
53
|
-
build_commands << "dotnet build source/#{project.name}.Pages/#{project.name}.Pages.csproj --configuration Release"
|
54
|
-
end
|
55
|
-
if File.exist?("source/#{project.name}.Pages/#{project.name}.Pages.csproj")
|
56
|
-
build_commands << "dotnet publish source/#{project.name}.Pages/#{project.name}.Pages.csproj --configuration Release --output artifacts/Pages"
|
57
|
-
end
|
61
|
+
build_commands << "dotnet pack tests/#{project.name}.Tests/#{project.name}.Tests.csproj --configuration Release --output artifacts/Packages"
|
58
62
|
steps = project.steps
|
59
63
|
if steps.any? { |step| step.name == "build" }
|
60
64
|
build_step = steps.find { |step| step.name == "build" }
|
data/lib/makit/version.rb
CHANGED