makit 0.0.34 → 0.0.36

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/lib/makit/apache.rb +32 -32
  3. data/lib/makit/cli/clean.rb +14 -14
  4. data/lib/makit/cli/clone.rb +59 -59
  5. data/lib/makit/cli/init.rb +38 -38
  6. data/lib/makit/cli/main.rb +33 -33
  7. data/lib/makit/cli/make.rb +54 -54
  8. data/lib/makit/cli/new.rb +37 -37
  9. data/lib/makit/cli/nuget_cache.rb +38 -38
  10. data/lib/makit/cli/pull.rb +31 -31
  11. data/lib/makit/cli/setup.rb +71 -71
  12. data/lib/makit/cli/work.rb +21 -21
  13. data/lib/makit/command_runner.rb +391 -353
  14. data/lib/makit/commands.rb +21 -21
  15. data/lib/makit/content/default_gitignore.rb +5 -5
  16. data/lib/makit/content/default_gitignore.txt +222 -222
  17. data/lib/makit/content/default_rakefile.rb +11 -11
  18. data/lib/makit/content/gem_rakefile.rb +14 -14
  19. data/lib/makit/data.rb +50 -50
  20. data/lib/makit/directories.rb +140 -140
  21. data/lib/makit/directory.rb +184 -184
  22. data/lib/makit/dotnet.rb +156 -134
  23. data/lib/makit/environment.rb +127 -127
  24. data/lib/makit/fileinfo.rb +16 -16
  25. data/lib/makit/files.rb +47 -47
  26. data/lib/makit/git.rb +86 -86
  27. data/lib/makit/gitlab_runner.rb +60 -60
  28. data/lib/makit/humanize.rb +112 -112
  29. data/lib/makit/indexer.rb +56 -0
  30. data/lib/makit/logging.rb +96 -96
  31. data/lib/makit/markdown.rb +75 -75
  32. data/lib/makit/mp/basic_object_mp.rb +16 -16
  33. data/lib/makit/mp/command_request.mp.rb +16 -16
  34. data/lib/makit/mp/project_mp.rb +210 -210
  35. data/lib/makit/mp/string_mp.rb +122 -122
  36. data/lib/makit/nuget.rb +57 -57
  37. data/lib/makit/protoc.rb +104 -104
  38. data/lib/makit/serializer.rb +115 -115
  39. data/lib/makit/show.rb +76 -77
  40. data/lib/makit/storage.rb +131 -131
  41. data/lib/makit/symbols.rb +149 -149
  42. data/lib/makit/tasks.rb +60 -60
  43. data/lib/makit/tree.rb +37 -37
  44. data/lib/makit/v1/makit.v1_pb.rb +4 -3
  45. data/lib/makit/v1/makit.v1_services_pb.rb +25 -25
  46. data/lib/makit/version.rb +12 -12
  47. data/lib/makit/wix.rb +95 -95
  48. data/lib/makit/zip.rb +17 -17
  49. data/lib/makit.rb +267 -267
  50. metadata +4 -5
  51. data/lib/generated/makit/v1/makit.v1_pb.rb +0 -34
  52. data/lib/generated/makit/v1/web/link_pb.rb +0 -20
data/lib/makit/wix.rb CHANGED
@@ -1,95 +1,95 @@
1
- require "securerandom"
2
-
3
- module Makit
4
- # This class provide methods for working with the Nuget package cache
5
- #
6
- # Example:
7
- #
8
- # Makit::Directory.cache("Google.Protobuf", "3.27.2")
9
- #
10
- # dotnet nuget locals all --list
11
- # dotnet nuget locals all --clear
12
- #
13
- class Wix
14
- def self.setup
15
- if (Makit::Environment.is_windows?)
16
- # test if dotnet is installed
17
- if !Makit::DotNet::is_installed? # !File.exist?(Makit::Environment.which("dotnet"))
18
- puts "dotnet does not appear to be installed"
19
- else
20
- # test if wix is already installed
21
- if !`dotnet tool list --global`.include?("wix")
22
- "dotnet tool install --global wix".run
23
- end
24
- puts " Wix version " + "#{Wix::version}".colorize(:green)
25
- # display the link to https://wixtoolset.org/
26
- puts " https://wixtoolset.org/".colorize(:green)
27
- # display the link to https://marketplace.visualstudio.com/items?itemName=FireGiant.FireGiantHeatWaveDev17
28
- puts " https://marketplace.visualstudio.com/items?itemName=FireGiant.FireGiantHeatWaveDev17".colorize(:green)
29
- end
30
- else
31
- puts "Wix is not supported on non-Windows platforms"
32
- end
33
- end
34
-
35
- def self.version
36
- `wix --version`.strip.split("+").first
37
- end
38
-
39
- def self.setup_package(name, path, files)
40
- # create the path if it does not exist
41
- FileUtils.mkdir_p(path) unless File.directory?(path)
42
- # create the #{name}.wixproj file
43
- File.open("#{path}/#{name}.wixproj", "w") do |f|
44
- f.puts "<Project Sdk=\"WixToolset.Sdk/#{Wix::version}\">"
45
- f.puts "</Project>"
46
- end
47
- # create the Package.wxs file
48
- File.open("#{path}/Package.wxs", "w") do |f|
49
- f.puts "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">"
50
- f.puts " <Package Name=\"#{name}\" Manufacturer=\"Acme\" Version=\"0.0.0.0\" UpgradeCode=\"#{SecureRandom.uuid}\">"
51
- #f.puts " <MajorUpgrade DowngradeErrorMessage=\"!(loc.DowngradeError)\" />"
52
- f.puts " <Files Include=\"#{files}\" />"
53
- #f.puts " <Feature Id=\"Main\">"
54
- #f.puts " <ComponentGroupRef Id=\"Components\" />"
55
- #f.puts " </Feature>"
56
- f.puts " </Package>"
57
- f.puts "</Wix>"
58
- end
59
- end
60
- end # class Wix
61
- end # module Makit
62
-
63
- # Package.wxs with File harvesting
64
- #<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
65
- # <Package Name="MyProduct" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="B0B15C00-1DC4-0374-A1D1-E902240936D5">
66
- # <Files Include="path\to\files\**" />
67
- # </Package>
68
- #</Wix>
69
-
70
- #<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
71
- # <Package Name="Msi.Demo" Manufacturer="Acme" Version="1.0.0.0" UpgradeCode="a87571ec-8be3-447e-ae23-b3a94a85b727">
72
- # <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" />
73
-
74
- # <Feature Id="Main">
75
- # <ComponentGroupRef Id="Components" />
76
- # </Feature>
77
- # </Package>
78
- #</Wix>
79
-
80
- #<Project Sdk="WixToolset.Sdk/5.0.1">
81
- #</Project>
82
-
83
- # Components.wxs
84
- #<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
85
- # <Fragment>
86
- # <ComponentGroup Id="Components" Directory="INSTALLFOLDER">
87
- # <Component Guid="b8085fb3-3718-46df-8bf6-ecf9f968dd3d">
88
- # <File Source="../../artifacts/Msi.Demo.exe" />
89
- # <File Source="../../artifacts/Msi.Demo.dll" />
90
- # <File Source="../../artifacts/Msi.Demo.deps.json" />
91
- # <File Source="../../artifacts/Msi.Demo.runtimeconfig.json" />
92
- # </Component>
93
- # </ComponentGroup>
94
- # </Fragment>
95
- #</Wix>
1
+ require "securerandom"
2
+
3
+ module Makit
4
+ # This class provide methods for working with the Nuget package cache
5
+ #
6
+ # Example:
7
+ #
8
+ # Makit::Directory.cache("Google.Protobuf", "3.27.2")
9
+ #
10
+ # dotnet nuget locals all --list
11
+ # dotnet nuget locals all --clear
12
+ #
13
+ class Wix
14
+ def self.setup
15
+ if (Makit::Environment.is_windows?)
16
+ # test if dotnet is installed
17
+ if !Makit::DotNet::is_installed? # !File.exist?(Makit::Environment.which("dotnet"))
18
+ puts "dotnet does not appear to be installed"
19
+ else
20
+ # test if wix is already installed
21
+ if !`dotnet tool list --global`.include?("wix")
22
+ "dotnet tool install --global wix".run
23
+ end
24
+ puts " Wix version " + "#{Wix::version}".colorize(:green)
25
+ # display the link to https://wixtoolset.org/
26
+ puts " https://wixtoolset.org/".colorize(:green)
27
+ # display the link to https://marketplace.visualstudio.com/items?itemName=FireGiant.FireGiantHeatWaveDev17
28
+ puts " https://marketplace.visualstudio.com/items?itemName=FireGiant.FireGiantHeatWaveDev17".colorize(:green)
29
+ end
30
+ else
31
+ puts "Wix is not supported on non-Windows platforms"
32
+ end
33
+ end
34
+
35
+ def self.version
36
+ `wix --version`.strip.split("+").first
37
+ end
38
+
39
+ def self.setup_package(name, path, files)
40
+ # create the path if it does not exist
41
+ FileUtils.mkdir_p(path) unless File.directory?(path)
42
+ # create the #{name}.wixproj file
43
+ File.open("#{path}/#{name}.wixproj", "w") do |f|
44
+ f.puts "<Project Sdk=\"WixToolset.Sdk/#{Wix::version}\">"
45
+ f.puts "</Project>"
46
+ end
47
+ # create the Package.wxs file
48
+ File.open("#{path}/Package.wxs", "w") do |f|
49
+ f.puts "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">"
50
+ f.puts " <Package Name=\"#{name}\" Manufacturer=\"Acme\" Version=\"0.0.0.0\" UpgradeCode=\"#{SecureRandom.uuid}\">"
51
+ #f.puts " <MajorUpgrade DowngradeErrorMessage=\"!(loc.DowngradeError)\" />"
52
+ f.puts " <Files Include=\"#{files}\" />"
53
+ #f.puts " <Feature Id=\"Main\">"
54
+ #f.puts " <ComponentGroupRef Id=\"Components\" />"
55
+ #f.puts " </Feature>"
56
+ f.puts " </Package>"
57
+ f.puts "</Wix>"
58
+ end
59
+ end
60
+ end # class Wix
61
+ end # module Makit
62
+
63
+ # Package.wxs with File harvesting
64
+ #<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
65
+ # <Package Name="MyProduct" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="B0B15C00-1DC4-0374-A1D1-E902240936D5">
66
+ # <Files Include="path\to\files\**" />
67
+ # </Package>
68
+ #</Wix>
69
+
70
+ #<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
71
+ # <Package Name="Msi.Demo" Manufacturer="Acme" Version="1.0.0.0" UpgradeCode="a87571ec-8be3-447e-ae23-b3a94a85b727">
72
+ # <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" />
73
+
74
+ # <Feature Id="Main">
75
+ # <ComponentGroupRef Id="Components" />
76
+ # </Feature>
77
+ # </Package>
78
+ #</Wix>
79
+
80
+ #<Project Sdk="WixToolset.Sdk/5.0.1">
81
+ #</Project>
82
+
83
+ # Components.wxs
84
+ #<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
85
+ # <Fragment>
86
+ # <ComponentGroup Id="Components" Directory="INSTALLFOLDER">
87
+ # <Component Guid="b8085fb3-3718-46df-8bf6-ecf9f968dd3d">
88
+ # <File Source="../../artifacts/Msi.Demo.exe" />
89
+ # <File Source="../../artifacts/Msi.Demo.dll" />
90
+ # <File Source="../../artifacts/Msi.Demo.deps.json" />
91
+ # <File Source="../../artifacts/Msi.Demo.runtimeconfig.json" />
92
+ # </Component>
93
+ # </ComponentGroup>
94
+ # </Fragment>
95
+ #</Wix>
data/lib/makit/zip.rb CHANGED
@@ -1,17 +1,17 @@
1
- # frozen_string_literal: true
2
-
3
- require "zip"
4
- require "fileutils"
5
-
6
- module Makit
7
- # Zip a directory
8
- class Zip
9
- def self.zip_directory(directory, zip_file)
10
- ::Zip::File.open(zip_file, ::Zip::File::CREATE) do |zipfile|
11
- Dir[File.join(directory, "**", "**")].each do |file|
12
- zipfile.add(file.sub("#{directory}/", ""), file)
13
- end
14
- end
15
- end
16
- end
17
- end
1
+ # frozen_string_literal: true
2
+
3
+ require "zip"
4
+ require "fileutils"
5
+
6
+ module Makit
7
+ # Zip a directory
8
+ class Zip
9
+ def self.zip_directory(directory, zip_file)
10
+ ::Zip::File.open(zip_file, ::Zip::File::CREATE) do |zipfile|
11
+ Dir[File.join(directory, "**", "**")].each do |file|
12
+ zipfile.add(file.sub("#{directory}/", ""), file)
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end