xcode-install 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/xcode/install.rb +15 -5
- data/lib/xcode/install/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7ba5033bc9c7837468a6579fbcf957d5e5e9f46
|
4
|
+
data.tar.gz: 09b92821948c600fc8bf6f5bb317f709bd50890e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19bf9ad9bd1f501769d2953a02c37d57e4c019e5fea462758d3a5751a648168549dfcd94832536cf66cac91828779e761c71238f5875728f1254b3853ec0dcfd
|
7
|
+
data.tar.gz: 170995f06db15fc32642dee98b68a4a461bd34a594721b2b15124a014ab2e78bf22f27849fe92b60866970e87d51d1904929038a52c7c0f7b5b00caeaf91f358
|
data/Gemfile
CHANGED
data/lib/xcode/install.rb
CHANGED
@@ -62,7 +62,7 @@ module XcodeInstall
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def installed_versions
|
65
|
-
|
65
|
+
installed.map { |x| InstalledXcode.new(x) }.sort do |a, b|
|
66
66
|
Gem::Version.new(a.version) <=> Gem::Version.new(b.version)
|
67
67
|
end
|
68
68
|
end
|
@@ -93,7 +93,9 @@ HELP
|
|
93
93
|
end
|
94
94
|
|
95
95
|
enable_developer_mode
|
96
|
-
InstalledXcode.new(xcode_path)
|
96
|
+
xcode = InstalledXcode.new(xcode_path)
|
97
|
+
xcode.approve_license
|
98
|
+
xcode.install_components
|
97
99
|
|
98
100
|
if switch
|
99
101
|
`sudo rm -f #{SYMLINK_PATH}` unless current_symlink.nil?
|
@@ -271,7 +273,7 @@ HELP
|
|
271
273
|
|
272
274
|
def initialize(path)
|
273
275
|
@path = Pathname.new(path)
|
274
|
-
@version = get_version
|
276
|
+
@version = get_version
|
275
277
|
end
|
276
278
|
|
277
279
|
def approve_license
|
@@ -283,10 +285,18 @@ HELP
|
|
283
285
|
`sudo /usr/libexec/PlistBuddy -c "add :IDEXcodeVersionForAgreedToGMLicense string #{@version}" #{license_plist_path}`
|
284
286
|
end
|
285
287
|
|
288
|
+
def install_components
|
289
|
+
`sudo installer -pkg #{@path}/Contents/Resources/Packages/MobileDevice.pkg -target /`
|
290
|
+
osx_build_version = `sw_vers -buildVersion`.chomp
|
291
|
+
tools_version = `/usr/libexec/PlistBuddy -c "Print :ProductBuildVersion" "#{@path}/Contents/version.plist"`.chomp
|
292
|
+
cache_dir = `getconf DARWIN_USER_CACHE_DIR`.chomp
|
293
|
+
`touch #{cache_dir}com.apple.dt.Xcode.InstallCheckCache_#{osx_build_version}_#{tools_version}`
|
294
|
+
end
|
295
|
+
|
286
296
|
:private
|
287
297
|
|
288
|
-
def get_version
|
289
|
-
output = `DEVELOPER_DIR='' "#{
|
298
|
+
def get_version
|
299
|
+
output = `DEVELOPER_DIR='' "#{@path}/Contents/Developer/usr/bin/xcodebuild" -version`
|
290
300
|
return '0.0' if output.nil? # ¯\_(ツ)_/¯
|
291
301
|
output.split("\n").first.split(' ')[1]
|
292
302
|
end
|