emplace 0.1.4 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/emplace.rb +55 -48
- data/test/emplace-test.rb +2 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b144f6bb99df6ed689df617404919bb2ba11249d
|
4
|
+
data.tar.gz: a88cb236d52bd5ec904545fca8912571f7861fa7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90367dc321118ecbc5023aa9daa100b64c5baee4b8801851699010855a4e7d8b7fd32c28ba3cc68a919732ebc926b19fcc3cdcb4e44f2359bd361781ce60a1fb
|
7
|
+
data.tar.gz: 93949f99b0da4a6762dad3153770fd8c47a4c522bd4214becb42d1a73116f896f570ecf0f925cedcff8f6068eb123ebf39cbb97ee71f97ee641bee7e08eb942c
|
data/lib/emplace.rb
CHANGED
@@ -24,7 +24,7 @@ module Emplace
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
class
|
27
|
+
class CMakeBuild
|
28
28
|
def build_dir
|
29
29
|
'build'
|
30
30
|
end
|
@@ -54,7 +54,7 @@ module Emplace
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
class Unix <
|
57
|
+
class Unix < CMakeBuild
|
58
58
|
def cmake_generator
|
59
59
|
'Unix Makefiles'
|
60
60
|
end
|
@@ -81,7 +81,7 @@ module Emplace
|
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
-
class Windows <
|
84
|
+
class Windows < CMakeBuild
|
85
85
|
def system_name
|
86
86
|
"win-#{arch}"
|
87
87
|
end
|
@@ -90,54 +90,59 @@ module Emplace
|
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
93
|
+
private
|
94
|
+
def self.travis(base)
|
95
|
+
Class.new(base) {
|
96
|
+
def system_name
|
97
|
+
if cc = ENV['CC']
|
98
|
+
"#{super}-#{cc}"
|
99
|
+
else
|
100
|
+
super
|
101
|
+
end
|
99
102
|
end
|
100
|
-
|
103
|
+
}
|
101
104
|
end
|
102
105
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
106
|
+
def self.appveyor(base)
|
107
|
+
Class.new(base) {
|
108
|
+
def cmake_generator
|
109
|
+
case arch
|
110
|
+
when 'x86'
|
111
|
+
'Visual Studio 14'
|
112
|
+
when 'x64'
|
113
|
+
'Visual Studio 14 Win64'
|
114
|
+
end
|
110
115
|
end
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
116
|
+
def arch
|
117
|
+
case ENV['PLATFORM']
|
118
|
+
when'x64'
|
119
|
+
'x64'
|
120
|
+
else
|
121
|
+
'x86'
|
122
|
+
end
|
118
123
|
end
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
124
|
+
def system_name
|
125
|
+
if cfg = ENV['CONFIGURATION']
|
126
|
+
"#{super}-msvc-#{cfg.downcase}"
|
127
|
+
else
|
128
|
+
"#{super}-msvc"
|
129
|
+
end
|
125
130
|
end
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
131
|
+
def build
|
132
|
+
if cfg = ENV['CONFIGURATION']
|
133
|
+
sh "cmake --build #{build_dir} --target install --config #{cfg}"
|
134
|
+
else
|
135
|
+
super
|
136
|
+
end
|
132
137
|
end
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
138
|
+
def package(name)
|
139
|
+
sh "7z a #{package_name(name)} #{name}", dist_dir
|
140
|
+
end
|
141
|
+
}
|
137
142
|
end
|
138
143
|
|
139
144
|
def self.load_env
|
140
|
-
case RUBY_PLATFORM
|
145
|
+
platform = case RUBY_PLATFORM
|
141
146
|
when /mswin|mingw/
|
142
147
|
Windows
|
143
148
|
when /darwin/
|
@@ -146,13 +151,15 @@ module Emplace
|
|
146
151
|
Linux
|
147
152
|
else
|
148
153
|
Unix
|
149
|
-
end
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
154
|
+
end
|
155
|
+
|
156
|
+
if ENV['TRAVIS']
|
157
|
+
travis platform
|
158
|
+
elsif ENV['APPVEYOR']
|
159
|
+
appveyor platform
|
160
|
+
else
|
161
|
+
platform
|
162
|
+
end.new
|
156
163
|
end
|
157
164
|
|
158
165
|
end
|
data/test/emplace-test.rb
CHANGED
@@ -52,9 +52,8 @@ class TestEmplace < Test::Unit::TestCase
|
|
52
52
|
], appveyor.commands
|
53
53
|
end
|
54
54
|
|
55
|
-
class Travis < Emplace::Linux
|
55
|
+
class Travis < Emplace.send(:travis, Emplace::Linux)
|
56
56
|
attr_reader :commands
|
57
|
-
include Emplace::Travis
|
58
57
|
def arch
|
59
58
|
'x86_64'
|
60
59
|
end
|
@@ -63,9 +62,8 @@ class TestEmplace < Test::Unit::TestCase
|
|
63
62
|
end
|
64
63
|
end
|
65
64
|
|
66
|
-
class AppVeyor < Emplace::Windows
|
65
|
+
class AppVeyor < Emplace.send(:appveyor, Emplace::Windows)
|
67
66
|
attr_reader :commands
|
68
|
-
include Emplace::AppVeyor
|
69
67
|
def arch
|
70
68
|
'x64'
|
71
69
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: emplace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Calhoun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Keeps settings for running cmake builds on Travis-CI and AppVeyor.
|
14
14
|
email:
|