framework-generate 0.1.0 → 0.2.0
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.
- checksums.yaml +4 -4
 - data/lib/SampleFrameworkSpec +21 -0
 - data/lib/framework-generate.rb +14 -1
 - data/lib/framework-generate/target.rb +6 -2
 - metadata +2 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: fef9f1fd34ff8648f028e22665e5303fd78d10ad
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: f3a85739d37b7898864147aa60a4883673e247ab
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 3fd36151284c6c0e5647ec11b72d33df7b3d686372a3bf389357398df0176a0dbe03a2772a9228577b25470dd646078828f8fb38ed62ffec2070bad8323c331c
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 1778457b557ee4a09bf9cd41b573202ddfefc338abdc833ac9af6acb2d553fe154cdbd65135b8fe9dc781acd30b7f4ac09b8048aef219e8110b0d0a192880fdd
         
     | 
| 
         @@ -0,0 +1,21 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            project.name = #PROJECT_NAME#
         
     | 
| 
      
 2 
     | 
    
         
            +
            project.language = swift("3.0")
         
     | 
| 
      
 3 
     | 
    
         
            +
            project.platforms = [
         
     | 
| 
      
 4 
     | 
    
         
            +
                macos("10.11"),
         
     | 
| 
      
 5 
     | 
    
         
            +
                ios("8.0"),
         
     | 
| 
      
 6 
     | 
    
         
            +
                tvos("9.0"),
         
     | 
| 
      
 7 
     | 
    
         
            +
                watchos("2.0")
         
     | 
| 
      
 8 
     | 
    
         
            +
            ]
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            target = new_target do |target|
         
     | 
| 
      
 11 
     | 
    
         
            +
              target.name = #TARGET_NAME#
         
     | 
| 
      
 12 
     | 
    
         
            +
              target.info_plist = #TARGET_INFO_PLIST#
         
     | 
| 
      
 13 
     | 
    
         
            +
              target.bundle_id = #TARGET_BUNDLE_ID#
         
     | 
| 
      
 14 
     | 
    
         
            +
              target.include_files = [
         
     | 
| 
      
 15 
     | 
    
         
            +
                #TARGET_INCLUDE_FILES#    
         
     | 
| 
      
 16 
     | 
    
         
            +
              ]
         
     | 
| 
      
 17 
     | 
    
         
            +
            end
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            project.targets = [
         
     | 
| 
      
 20 
     | 
    
         
            +
              target
         
     | 
| 
      
 21 
     | 
    
         
            +
            ]
         
     | 
    
        data/lib/framework-generate.rb
    CHANGED
    
    | 
         @@ -1,10 +1,23 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'fileutils'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
       1 
3 
     | 
    
         
             
            module FrameworkGenerate
         
     | 
| 
       2 
4 
     | 
    
         
             
              class Runner
         
     | 
| 
       3 
5 
     | 
    
         
             
                def self.generate
         
     | 
| 
       4 
6 
     | 
    
         
             
                  file_path = "#{Dir.pwd}/FrameworkSpec"
         
     | 
| 
       5 
7 
     | 
    
         | 
| 
       6 
8 
     | 
    
         
             
                  unless File.exist?(file_path)
         
     | 
| 
       7 
     | 
    
         
            -
                     
     | 
| 
      
 9 
     | 
    
         
            +
                    puts "Couldn't find FrameworkSpec. Do you want to create one? [Y/N]"
         
     | 
| 
      
 10 
     | 
    
         
            +
                    create_file = gets.chomp
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
                    if create_file == "Y"
         
     | 
| 
      
 13 
     | 
    
         
            +
                      sample_framework_spec = File.join(File.dirname(__FILE__), 'SampleFrameworkSpec')
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
                      FileUtils.cp(sample_framework_spec, file_path)
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                      abort "Created a FrameworkSpec. Update the contents of the FrameworkSpec file and rerun the command"
         
     | 
| 
      
 18 
     | 
    
         
            +
                    elsif
         
     | 
| 
      
 19 
     | 
    
         
            +
                      abort "Cannot create a project without a FrameworkSpec"
         
     | 
| 
      
 20 
     | 
    
         
            +
                    end
         
     | 
| 
       8 
21 
     | 
    
         
             
                  end
         
     | 
| 
       9 
22 
     | 
    
         | 
| 
       10 
23 
     | 
    
         
             
                  file_contents = File.read(file_path)
         
     | 
| 
         @@ -76,8 +76,12 @@ module FrameworkGenerate 
     | 
|
| 
       76 
76 
     | 
    
         
             
                end
         
     | 
| 
       77 
77 
     | 
    
         | 
| 
       78 
78 
     | 
    
         
             
                def add_source_files(project, target)
         
     | 
| 
       79 
     | 
    
         
            -
                   
     | 
| 
       80 
     | 
    
         
            -
                     
     | 
| 
      
 79 
     | 
    
         
            +
                  if @exclude_files == nil
         
     | 
| 
      
 80 
     | 
    
         
            +
                    exclude_files = []
         
     | 
| 
      
 81 
     | 
    
         
            +
                  else
         
     | 
| 
      
 82 
     | 
    
         
            +
                    exclude_files = @exclude_files.map do |files|
         
     | 
| 
      
 83 
     | 
    
         
            +
                      Dir[files]
         
     | 
| 
      
 84 
     | 
    
         
            +
                    end
         
     | 
| 
       81 
85 
     | 
    
         
             
                  end
         
     | 
| 
       82 
86 
     | 
    
         | 
| 
       83 
87 
     | 
    
         
             
                  source_files = @include_files.map do |files|
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: framework-generate
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Pierre-Marc Airoldi
         
     | 
| 
         @@ -41,6 +41,7 @@ files: 
     | 
|
| 
       41 
41 
     | 
    
         
             
            - LICENSE
         
     | 
| 
       42 
42 
     | 
    
         
             
            - README.md
         
     | 
| 
       43 
43 
     | 
    
         
             
            - bin/framework-generate
         
     | 
| 
      
 44 
     | 
    
         
            +
            - lib/SampleFrameworkSpec
         
     | 
| 
       44 
45 
     | 
    
         
             
            - lib/framework-generate.rb
         
     | 
| 
       45 
46 
     | 
    
         
             
            - lib/framework-generate/copy-carthage-frameworks.sh
         
     | 
| 
       46 
47 
     | 
    
         
             
            - lib/framework-generate/language.rb
         
     |