makit 0.0.33 → 0.0.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/makit/dotnet.rb +27 -5
- 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: a79c18c93c439b527f46d64e9689594f70bb2acf3fe9a9b44d453509dc3621b7
|
4
|
+
data.tar.gz: 6d7aa7f2db172dab97275258f2dde38e11e896232be3a6270e67b0990e384f5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d99bf18acad1e3278e382b8b83484c19ccbcd3bf2e6e2f7aed4fcb4cbc0b1bdce8f8a9d74d5130d67cb65f5d2d9a876b06965b5c3c212db5219c1b9f7f8b1106
|
7
|
+
data.tar.gz: 96ef113e6ae16f1e378b18d13ccf28749affe9430ae05e0a55c359150c4176ccd57d27c7751a8a270b402d6af8fbb5daadfdd5c3808e98ad50110a020c4c857f
|
data/lib/makit/dotnet.rb
CHANGED
@@ -17,11 +17,11 @@ module Makit
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
def find_project(project_hint)
|
20
|
+
def self.find_project(project_hint)
|
21
21
|
matches = []
|
22
22
|
Dir.glob("**/*.csproj").each do |project_path|
|
23
|
-
project_name = File.basename(project_path, ".csproj")
|
24
|
-
if
|
23
|
+
#project_name = File.basename(project_path, ".csproj")
|
24
|
+
if project_path.include?(project_hint)
|
25
25
|
matches << project_path
|
26
26
|
end
|
27
27
|
end
|
@@ -35,7 +35,7 @@ module Makit
|
|
35
35
|
|
36
36
|
def self.add_package(project_path, package_name)
|
37
37
|
if(!File.exist?(project_path))
|
38
|
-
actual_project_path = Makit::DotNet
|
38
|
+
actual_project_path = Makit::DotNet::find_project(project_path)
|
39
39
|
if(!File.exist?(actual_project_path))
|
40
40
|
raise "Project #{project_path} does not exist".colorize(:red)
|
41
41
|
else
|
@@ -57,14 +57,36 @@ module Makit
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def self.add_reference(project_path, reference_path)
|
60
|
+
if(!File.exist?(project_path))
|
61
|
+
actual_project_path = Makit::DotNet::find_project(project_path)
|
62
|
+
if(!File.exist?(actual_project_path))
|
63
|
+
raise "Project #{project_path} does not exist".colorize(:red)
|
64
|
+
else
|
65
|
+
project_path = actual_project_path
|
66
|
+
end
|
67
|
+
end
|
68
|
+
if(!File.exist?(reference_path))
|
69
|
+
actual_reference_path = Makit::DotNet::find_project(reference_path)
|
70
|
+
if(!File.exist?(actual_reference_path))
|
71
|
+
raise "Project #{reference_path} does not exist".colorize(:red)
|
72
|
+
else
|
73
|
+
reference_path = actual_reference_path
|
74
|
+
end
|
75
|
+
end
|
60
76
|
project_content = File.read(project_path)
|
61
|
-
if (project_content.include?(
|
77
|
+
if (project_content.include?(File.basename(reference_path)))
|
62
78
|
#puts " reference ".colorize(:grey) + "#{reference_path}".colorize(:yellow) + " is in ".colorize(:grey) + "#{project_path}".colorize(:yellow)
|
63
79
|
else
|
64
80
|
"dotnet add #{project_path} reference #{reference_path}".run
|
65
81
|
end
|
66
82
|
end
|
67
83
|
|
84
|
+
def self.add_references(project_path, references)
|
85
|
+
references.each do |reference|
|
86
|
+
add_reference(project_path, reference)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
68
90
|
def self.new_solution(name)
|
69
91
|
if File.exist? "#{name}.sln"
|
70
92
|
#puts "Solution #{name}.sln already exists".colorize(:yellow)
|
data/lib/makit/version.rb
CHANGED