dev_tasks 0.0.146 → 0.0.147
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.
- data/lib/environment.rb +24 -1
- data/lib/publish.rb +6 -10
- data/lib/spec.json +1 -1
- data/spec/test_data/cpp_projects/helloLib/rakefile.rb +6 -1
- metadata +1 -1
data/lib/environment.rb
CHANGED
@@ -10,6 +10,29 @@ class Environment < Hash
|
|
10
10
|
"none"
|
11
11
|
end
|
12
12
|
|
13
|
+
def self.copy src,dest
|
14
|
+
FileUtils.mkdir_p File.dirname(dest) if !File.exists?(File.dirname(dest))
|
15
|
+
FileUtils.cp(src,dest)
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.copy_files files,dest
|
19
|
+
Console.debug("Environment.copy_files([#{files.to_s}],'#{dest}'')")
|
20
|
+
files.each{|f|
|
21
|
+
if(File.directory?(dest))
|
22
|
+
Console.debug "copying #{f} to #{dest}/#{f}"
|
23
|
+
FileUtils.cp(f,dest + "/" + f)
|
24
|
+
end
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.svn_add_all dir
|
29
|
+
Dir.chdir(dir) do
|
30
|
+
Dir.glob('**/*').each{|f|
|
31
|
+
puts `svn add #{f}`
|
32
|
+
}
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
13
36
|
def self.scm_origin
|
14
37
|
if(Dir.exists?(".git"))
|
15
38
|
`git remote show origin`.scan(/Fetch URL: ([\w:\/.-]+)/).each{|m|
|
@@ -30,7 +53,7 @@ class Environment < Hash
|
|
30
53
|
return m.first.to_s
|
31
54
|
}
|
32
55
|
end
|
33
|
-
""
|
56
|
+
"0"
|
34
57
|
end
|
35
58
|
|
36
59
|
def self.dev_root
|
data/lib/publish.rb
CHANGED
@@ -17,9 +17,10 @@ class Publish < Array
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def update
|
20
|
+
Console.debug "Publish.update"
|
20
21
|
if(defined?(DEV_TASKS))
|
21
22
|
if(DEV_TASKS).has_key?(:publish_path)
|
22
|
-
if(DEV_TASKS[:publish_path].include?('svn://'))
|
23
|
+
if(DEV_TASKS[:publish_path].include?('svn://') || DEV_TASKS[:publish_path].include?('file:///'))
|
23
24
|
latestRev=Environment.svn_latest_revision
|
24
25
|
svn_publish_uri="#{DEV_TASKS[:publish_path]}/#{DEV_TASKS[:relative_directory]}-#{latestRev}"
|
25
26
|
local_dir="#{Environment.dev_root}/tmp/#{DEV_TASKS[:relative_directory]}@#{latestRev}"
|
@@ -32,15 +33,10 @@ class Publish < Array
|
|
32
33
|
Console.debug "adding publish commands.."
|
33
34
|
add "svn mkdir #{svn_publish_uri} --parents -m\"publish\""
|
34
35
|
add "svn checkout #{svn_publish_uri} #{local_dir}"
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
add "<%FileUtils.mkdir_p('#{dest_dir}') if !File.exists?('#{dest_dir}')%>"
|
40
|
-
add "<%FileUtils.cp('#{dep_dir}/#{a}','#{local_dir}/#{a}') if File.exists?('#{dep_dir}/#{a}')%>"
|
41
|
-
add "svn add #{local_dir}/#{a} --parents"
|
42
|
-
}
|
43
|
-
add "svn commit #{local_dir} -m\"publish\""
|
36
|
+
add "<%Environment.copy_files(DEV_TASKS[:files][:artifact],'#{local_dir}')%>"
|
37
|
+
add "<%Environment.svn_add_all('#{local_dir}')%>"
|
38
|
+
add "svn commit #{local_dir}@ -m\"publish\""
|
39
|
+
#add "<%FileUtils.rm_r('#{local_dir}')%>"
|
44
40
|
end
|
45
41
|
end
|
46
42
|
end
|
data/lib/spec.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"name":"dev_tasks","version":"0.0.
|
1
|
+
{"name":"dev_tasks","version":"0.0.147"}
|
@@ -1 +1,6 @@
|
|
1
|
-
require_relative '../../../../lib/dev_tasks.rb'
|
1
|
+
require_relative '../../../../lib/dev_tasks.rb'
|
2
|
+
|
3
|
+
DEV[:debug]=true
|
4
|
+
DEV[:commands][:setup] << "svnadmin create repo" if(!File.exists?('repo'))
|
5
|
+
DEV[:publish_path]="file:///#{DEV[:working_directory]}/repo"
|
6
|
+
CLOBBER.include("repo")
|