fastlane-plugin-create_dmg 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +48 -0
  3. data/README.md +52 -0
  4. data/lib/fastlane/plugin/create_dmg/actions/create_dmg_action.rb +226 -0
  5. data/lib/fastlane/plugin/create_dmg/actions/update_dmg_action.rb +118 -0
  6. data/lib/fastlane/plugin/create_dmg/assets/update-dmg.sh +206 -0
  7. data/lib/fastlane/plugin/create_dmg/helper/create_dmg_helper.rb +86 -0
  8. data/lib/fastlane/plugin/create_dmg/helper/update_dmg_helper.rb +43 -0
  9. data/lib/fastlane/plugin/create_dmg/vendor/create-dmg/LICENSE +22 -0
  10. data/lib/fastlane/plugin/create_dmg/vendor/create-dmg/Makefile +33 -0
  11. data/lib/fastlane/plugin/create_dmg/vendor/create-dmg/README.md +115 -0
  12. data/lib/fastlane/plugin/create_dmg/vendor/create-dmg/builder/create-dmg.builder +26 -0
  13. data/lib/fastlane/plugin/create_dmg/vendor/create-dmg/create-dmg +484 -0
  14. data/lib/fastlane/plugin/create_dmg/vendor/create-dmg/doc-project/Developer Notes.md +35 -0
  15. data/lib/fastlane/plugin/create_dmg/vendor/create-dmg/doc-project/Release Checklist.md +10 -0
  16. data/lib/fastlane/plugin/create_dmg/vendor/create-dmg/examples/01-main-example/installer_background.png +0 -0
  17. data/lib/fastlane/plugin/create_dmg/vendor/create-dmg/examples/01-main-example/sample +25 -0
  18. data/lib/fastlane/plugin/create_dmg/vendor/create-dmg/examples/01-main-example/source_folder/Application.app +0 -0
  19. data/lib/fastlane/plugin/create_dmg/vendor/create-dmg/support/eula-resources-template.xml +105 -0
  20. data/lib/fastlane/plugin/create_dmg/vendor/create-dmg/support/template.applescript +74 -0
  21. data/lib/fastlane/plugin/create_dmg/vendor/create-dmg/tests/007-space-in-dir-name/my files/hello.txt +1 -0
  22. data/lib/fastlane/plugin/create_dmg/vendor/create-dmg/tests/007-space-in-dir-name/run-test +5 -0
  23. data/lib/fastlane/plugin/create_dmg/version.rb +5 -0
  24. data/lib/fastlane/plugin/create_dmg.rb +16 -0
  25. data/lib/fastlane.dmg +0 -0
  26. metadata +207 -0
@@ -0,0 +1,86 @@
1
+ require 'fastlane_core/ui/ui'
2
+
3
+ module Fastlane
4
+ module Helper
5
+ class CreateDmgHelper
6
+ attr_accessor :verbose, :source, :source_basename, :output_filename
7
+
8
+ def initialize(params: nil)
9
+ self.params = params
10
+ self.verbose = self.params[:verbose] == true
11
+ self.source = File.expand_path(self.params[:source])
12
+ self.source_basename = File.basename(self.source)
13
+ self.source_basename_no_extension = File.basename(self.source, File.extname(self.source))
14
+ output_filename = self.params[:output_filename] || "#{File.dirname(self.source)}/#{self.source_basename_no_extension}.dmg"
15
+ self.output_filename = File.expand_path(output_filename)
16
+ end
17
+
18
+ # rubocop:disable Metrics/PerceivedComplexity
19
+ def create_dmg_parameters
20
+ volume_name = self.params[:volume_name] || self.source_basename_no_extension
21
+ addiional_files = self.params[:addiional_files] || []
22
+
23
+ self.verbose = self.params[:verbose] == true
24
+
25
+ if params[:hdiutil_sandbox_safe]
26
+ ## TODO: Warnings about turned off but used options
27
+ end
28
+
29
+ parameters = {
30
+ '--volname' => volume_name,
31
+ '--volicon' => self.params[:volume_icon],
32
+ '--format' => self.params[:volume_format],
33
+ '--disk-image-size' => self.params[:volume_size],
34
+
35
+ '--window-pos' => self.params[:window_position],
36
+ '--window_size' => self.params[:window_size],
37
+
38
+ '--background' => self.params[:background],
39
+ '--text-size' => self.params[:text_size],
40
+ '--icon-size' => self.params[:icon_size],
41
+
42
+ '--app-drop-link' => self.params[:applications_folder_position],
43
+ '--ql-drop-link' => self.params[:quick_look_folder_position],
44
+
45
+ '--eula' => self.params[:eula_filename]
46
+ }
47
+
48
+ if self.params[:source_icon_position]
49
+ parameters['--icon'] = "#{self.source_basename} #{self.params[:source_icon_position]}"
50
+ end
51
+
52
+ if self.params[:hide_source_extension]
53
+ parameters['--hide-extension'] = self.source_basename
54
+ end
55
+
56
+ create_dmg_parameters = []
57
+ parameters.each do |key, value|
58
+ if value
59
+ create_dmg_parameters << key.to_s
60
+ create_dmg_parameters << value.to_s
61
+ end
62
+ end
63
+
64
+ addiional_files.each do |additional_file|
65
+ create_dmg_parameters << '--file'
66
+ create_dmg_parameters << additional_file
67
+ end
68
+
69
+ create_dmg_parameters << '--hdiutil-verbose' if self.params[:hdiutil_verbose]
70
+ create_dmg_parameters << '--hdiutil-quiet' if self.params[:hdiutil_quiet]
71
+ create_dmg_parameters << '--sandbox-safe' if self.params[:hdiutil_sandbox_safe]
72
+
73
+ create_dmg_parameters << '--no-internet-enable' # `internet-enable` is not supported any more.
74
+
75
+ create_dmg_parameters << self.output_filename
76
+
77
+ return create_dmg_parameters
78
+ end
79
+ # rubocop:enable Metrics/PerceivedComplexity
80
+
81
+ private
82
+
83
+ attr_accessor :params, :source_basename_no_extension
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,43 @@
1
+ require 'fastlane_core/ui/ui'
2
+
3
+ module Fastlane
4
+ module Helper
5
+ class UpdateDmgHelper
6
+ attr_accessor :verbose, :source, :output_filename
7
+
8
+ def initialize(params: nil)
9
+ self.params = params
10
+ self.verbose = self.params[:verbose] == true
11
+ self.source = File.expand_path(self.params[:source])
12
+ source_basename_no_extension = File.basename(self.source, File.extname(source))
13
+ output_filename = self.params[:output_filename] || "#{File.dirname(self.source)}/#{source_basename_no_extension}.dmg"
14
+ self.output_filename = File.expand_path(output_filename)
15
+ end
16
+
17
+ def update_dmg_parameters
18
+ parameters = {
19
+ '--source' => self.source,
20
+ '--output-dmg' => self.output_filename,
21
+ '--template-dmg' => self.params[:template]
22
+ }
23
+
24
+ update_dmg_parameters = []
25
+ parameters.each do |key, value|
26
+ if value
27
+ update_dmg_parameters << key.to_s
28
+ update_dmg_parameters << value.to_s
29
+ end
30
+ end
31
+
32
+ update_dmg_parameters << '--hdiutil-verbose' if self.params[:hdiutil_verbose]
33
+ update_dmg_parameters << '--hdiutil-quiet' if self.params[:hdiutil_quiet]
34
+
35
+ return update_dmg_parameters
36
+ end
37
+
38
+ private
39
+
40
+ attr_accessor :params
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2008-2014 Andrey Tarantsov
4
+ Copyright (c) 2020 Andrew Janke
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
@@ -0,0 +1,33 @@
1
+ # Makefile for Cowsay
2
+
3
+ PACKAGE_TARNAME = create-dmg
4
+
5
+ prefix = /usr/local
6
+ exec_prefix = ${prefix}
7
+ bindir = ${exec_prefix}/bin
8
+ datarootdir = ${prefix}/share
9
+ datadir = ${datarootdir}
10
+ docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
11
+ sysconfdir = ${prefix}/etc
12
+ mandir=${datarootdir}/man
13
+ srcdir = .
14
+
15
+ SHELL = /bin/sh
16
+ INSTALL = install
17
+ INSTALL_PROGRAM = $(INSTALL)
18
+ INSTALL_DATA = ${INSTALL} -m 644
19
+
20
+ .PHONY: install uninstall
21
+
22
+ install: create-dmg
23
+ $(INSTALL) -d $(DESTDIR)$(prefix)
24
+ $(INSTALL) -d $(DESTDIR)$(bindir)
25
+ $(INSTALL_PROGRAM) create-dmg $(DESTDIR)$(bindir)/create-dmg
26
+ $(INSTALL) -d $(DESTDIR)$(datadir)/$(PACKAGE_TARNAME)
27
+ cp -R support $(DESTDIR)$(datadir)/$(PACKAGE_TARNAME)
28
+ cp -R examples $(DESTDIR)$(datadir)/$(PACKAGE_TARNAME)
29
+ cp -R tests $(DESTDIR)$(datadir)/$(PACKAGE_TARNAME)
30
+
31
+ uninstall:
32
+ rm -f $(DESTDIR)$(bindir)/create-dmg
33
+ rm -rf $(DESTDIR)$(datadir)/$(PACKAGE_TARNAME)
@@ -0,0 +1,115 @@
1
+ create-dmg
2
+ ==========
3
+
4
+ A shell script to build fancy DMGs.
5
+
6
+ Status and contribution policy
7
+ ------------------------------
8
+
9
+ Create-dmg is maintained thanks to the contributors who send pull requests.
10
+ As of May 2020, [Andrew Janke](https://github.com/apjanke) is the primary maintainer, and (since September 2018) [@aonez](https://github.com/aonez) has helped with the maintenance.
11
+ The project home page is <https://github.com/create-dmg/create-dmg>.
12
+
13
+ We will merge any pull request that adds something useful and does not break existing things.
14
+
15
+ If you're an active user and want to be a maintainer, or just want to chat, please ping us on Gitter at [gitter.im/create-dmg/Lobby](https://gitter.im/create-dmg/Lobby), or [email Andrew directly](floss@apjanke.net).
16
+
17
+ Create-dmg was originally created by [Andrey Tarantsov](https://github.com/andreyvit).
18
+
19
+ Installation
20
+ ------------
21
+
22
+ - You can install this script using [Homebrew](https://brew.sh):
23
+
24
+ ```sh
25
+ brew install create-dmg
26
+ ```
27
+
28
+ - You can download the [latest release](https://github.com/create-dmg/create-dmg/releases/latest) and install it from there:
29
+
30
+ ```sh
31
+ make install
32
+ ```
33
+
34
+ - You can also clone the entire repository and run it locally from there:
35
+
36
+ ```sh
37
+ git clone https://github.com/create-dmg/create-dmg.git
38
+ ```
39
+
40
+ Usage
41
+ -----
42
+
43
+ ```sh
44
+ create-dmg [options ...] <output_name.dmg> <source_folder>
45
+ ```
46
+
47
+ All contents of source\_folder will be copied into the disk image.
48
+
49
+ **Options:**
50
+
51
+ - **--volname \<name\>:** set volume name (displayed in the Finder sidebar and window title)
52
+ - **--volicon \<icon.icns\>:** set volume icon
53
+ - **--background \<pic.png\>:** set folder background image (provide png, gif, jpg)
54
+ - **--window-pos \<x\> \<y\>:** set position the folder window
55
+ - **--window-size \<width\> \<height\>:** set size of the folder window
56
+ - **--text-size \<text_size\>:** set window text size (10-16)
57
+ - **--icon-size \<icon_size\>:** set window icons size (up to 128)
58
+ - **--icon \<file_name\> \<x\> \<y\>:** set position of the file's icon
59
+ - **--hide-extension \<file_name\>:** hide the extension of file
60
+ - **--custom-icon \<file_name|custom_icon|sample_file\> \<x\> \<y\>:** set position and -tom icon
61
+ - **--app-drop-link \<x\> \<y\>:** make a drop link to Applications, at location x, y
62
+ - **--ql-drop-link \<x\> \<y\>:** make a drop link to /Library/QuickLook, at location x, y
63
+ - **--eula \<eula_file\>:** attach a license file to the dmg
64
+ - **--rez \<rez_path\>:** specify custom path to Rez tool used to include license file
65
+ - **--no-internet-enable:** disable automatic mount&copy
66
+ - **--format:** specify the final image format (default is UDZO)
67
+ - **--add-file \<target_name\> \<file|folder\> \<x\> \<y\>:** add additional file or folder (can be used multiple times)
68
+ - **--disk-image-size \<x\>:** set the disk image size manually to x MB
69
+ - **--hdiutil-verbose:** execute hdiutil in verbose mode
70
+ - **--hdiutil-quiet:** execute hdiutil in quiet mode
71
+ - **--sandbox-safe:** execute hdiutil with sandbox compatibility, do not bless and do not execute the cosmetic AppleScript
72
+ - **--version:** show tool version number
73
+ - **-h, --help:** display the help
74
+
75
+ Example
76
+ -------
77
+
78
+ ```sh
79
+ #!/bin/sh
80
+ test -f Application-Installer.dmg && rm Application-Installer.dmg
81
+ create-dmg \
82
+ --volname "Application Installer" \
83
+ --volicon "application_icon.icns" \
84
+ --background "installer_background.png" \
85
+ --window-pos 200 120 \
86
+ --window-size 800 400 \
87
+ --icon-size 100 \
88
+ --icon "Application.app" 200 190 \
89
+ --hide-extension "Application.app" \
90
+ --app-drop-link 600 185 \
91
+ "Application-Installer.dmg" \
92
+ "source_folder/"
93
+ ```
94
+
95
+ See the `examples` folder in the source tree for more examples.
96
+
97
+ Requirements
98
+ ------------
99
+
100
+ Nothing except a standard installation of macOS/OS X is required.
101
+
102
+ We think this works in OS X 10.6 Snow Leopard and later.
103
+
104
+ We'd like to keep it working in as many versions as possible, but unfortunately, we just don't have test boxes running old versions of OS X adequate to make this happen. Development and testing mostly happens in the last 3-5 years' worth of macOS releases; as of 2020, this means macOS 10.12 and later.
105
+
106
+ But if you find a bug in an older version, go ahead and report it! We'll try to work with you to get it fixed.
107
+
108
+ If you're running OS X 10.5 or later, you're SOL. That's just too hard to deal with in 2020. ;)
109
+
110
+ Alternatives
111
+ ------------
112
+
113
+ - [node-appdmg](https://github.com/LinusU/node-appdmg)
114
+ - [dmgbuild](https://pypi.python.org/pypi/dmgbuild)
115
+ - see the [StackOverflow question](http://stackoverflow.com/questions/96882/how-do-i-create-a-nice-looking-dmg-for-mac-os-x-using-command-line-tools)
@@ -0,0 +1,26 @@
1
+ SET app_name create-dmg
2
+
3
+ VERSION create-dmg.cur create-dmg heads/master
4
+
5
+ NEWDIR build.dir temp %-build -
6
+
7
+ NEWFILE create-dmg.zip featured %.zip %
8
+
9
+
10
+ COPYTO [build.dir]
11
+ INTO create-dmg [create-dmg.cur]/create-dmg
12
+ INTO sample [create-dmg.cur]/sample
13
+ INTO support [create-dmg.cur]/support
14
+
15
+ SUBSTVARS [build.dir<alter>]/create-dmg [[]]
16
+
17
+
18
+ ZIP [create-dmg.zip]
19
+ INTO [build-files-prefix] [build.dir]
20
+
21
+
22
+ PUT megabox-builds create-dmg.zip
23
+ PUT megabox-builds build.log
24
+
25
+ PUT s3-builds create-dmg.zip
26
+ PUT s3-builds build.log