Class: ProjectGen::Command::Gen
- Inherits:
-
ProjectGen::Command
- Object
- CLAide::Command
- ProjectGen::Command
- ProjectGen::Command::Gen
- Defined in:
- lib/cocoapods-project-gen/command/gen.rb
Overview
hmap file gen cmd
Class Method Summary collapse
-
.options ⇒ Object
help.
Instance Method Summary collapse
-
#initialize(argv) ⇒ Gen
constructor
A new instance of Gen.
- #run ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(argv) ⇒ Gen
Returns a new instance of Gen.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/cocoapods-project-gen/command/gen.rb', line 18 def initialize(argv) super @build = argv.flag?('build', true) @local = argv.flag?('local') @build_library_for_distribution = argv.flag?('build-library-for-distribution') @use_latest = argv.flag?('use-latest', true) output_dir = argv.option('output-dir', Pathname.pwd) @output_dir = Pathname.new(output_dir)..join('project_gen/App') @allow_warnings = argv.flag?('allow-warnings', true) @clean = argv.flag?('clean', false) @only_subspecs = argv.option('subspecs', '').split(',') @use_frameworks = !argv.flag?('use-libraries') @use_modular_headers = argv.flag?('use-modular-headers', true) @use_static_frameworks = argv.flag?('use-static-frameworks') @source_urls = argv.option('sources', Pod::TrunkSource::TRUNK_REPO_URL).split(',') @platforms = argv.option('platforms', '').split(',') @swift_version = argv.option('swift-version', nil) @include_podspecs = argv.option('include-podspecs', '').split(',').map { |path| Pathname.new(path). } @external_podspecs = argv.option('external-podspecs', '').split(',').map { |path| Pathname.new(path). } @podspecs_paths = argv.arguments! @configuration = argv.option('configuration', nil) end |
Class Method Details
.options ⇒ Object
help
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/cocoapods-project-gen/command/gen.rb', line 46 def self. [ ['--no-build', 'Is or is not to build xcframework'], ['--build-library-for-distribution', ' Enables BUILD_LIBRARY_FOR_DISTRIBUTION'], ['--use-latest', 'When multiple dependencies with different sources, use latest.'], ['--local', 'podpsecs is local or not'], ['--output-dir=/project/dir/', 'Gen output dir'], ['--allow-warnings', 'Gen even if warnings are present'], ['--subspecs=NAME/NAME', 'Gen only the given subspecs'], ['--no-clean', 'Gen leaves the build directory intact for inspection'], ['--use-libraries', 'Gen uses static libraries to install the spec'], ['--use-modular-headers', 'Gen uses modular headers during installation'], ['--use-static-frameworks', 'Gen uses static frameworks during installation'], ["--sources=#{Pod::TrunkSource::TRUNK_REPO_URL}", 'The sources from which to pull dependent pods ' \ "(defaults to #{Pod::TrunkSource::TRUNK_REPO_URL}). Multiple sources must be comma-delimited"], ['--platforms=ios,macos', 'Gen against specific platforms (defaults to all platforms supported by the ' \ 'podspec). Multiple platforms must be comma-delimited'], ['--swift-version=VERSION', 'The `SWIFT_VERSION` that should be used to gen the spec. ' \ 'This takes precedence over the Swift versions specified by the spec or a `.swift-version` file'], ['--include-podspecs=**/*.podspec', 'Additional ancillary podspecs which are used for gening via :path'], ['--external-podspecs=**/*.podspec', 'Additional ancillary podspecs which are used for gening '\ 'via :podspec. If there are --include-podspecs, then these are removed from them'], ['--configuration=CONFIGURATION', 'Build using the given configuration (defaults to Release)'] ].concat(super) end |
Instance Method Details
#run ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/cocoapods-project-gen/command/gen.rb', line 72 def run generator = ProjectGenerator.new(@source_urls, @platforms) generator.local = @local generator.no_clean = !@clean generator.use_latest = @use_latest generator.allow_warnings = @allow_warnings generator.only_subspecs = @only_subspecs generator.use_frameworks = @use_frameworks generator.use_modular_headers = @use_modular_headers generator.use_static_frameworks = @use_static_frameworks generator.swift_version = @swift_version generator.include_podspecs = @include_podspecs generator.external_podspecs = @external_podspecs if @local generator.include_podspecs += podspecs_to_gen generator.include_podspecs.uniq! else generator.external_podspecs += podspecs_to_gen generator.external_podspecs.uniq! end if generator.include_podspecs.empty? && generator.external_podspecs.empty? results = Results.new results.error('gen', 'Unable to find podspecs in the working dir. Is local or not local?') results.print_results else generator.configuration = @configuration xc_gen = ProjectGen::XcframeworkGen.new(generator) xc_gen.generate_xcframework(@output_dir, build: @build, build_library_for_distribution: @build_library_for_distribution) end end |
#validate! ⇒ Object
41 42 43 |
# File 'lib/cocoapods-project-gen/command/gen.rb', line 41 def validate! super end |