├── .github ├── FUNDING.yml ├── config │ ├── config.js │ ├── package-lock.json │ ├── package.json │ └── pre_changelog_hook.js ├── dependabot.yml └── workflows │ ├── codeql-analysis.yml │ └── main.yml ├── .gitignore ├── .vscode └── extensions.json ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── README.md ├── Rakefile ├── cocoapods-embed-flutter.gemspec ├── example ├── flutter_module │ ├── .gitignore │ ├── .metadata │ ├── README.md │ ├── analysis_options.yaml │ ├── flutter_module.iml │ ├── flutter_module_android.iml │ ├── lib │ │ └── main.dart │ ├── pubspec.lock │ ├── pubspec.yaml │ └── test │ │ └── widget_test.dart └── ios_app │ ├── Gemfile │ ├── Gemfile.lock │ ├── Podfile │ ├── Podfile.lock │ ├── ios_app.xcodeproj │ └── project.pbxproj │ └── ios_app │ ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── ContentView.swift │ ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json │ └── ios_appApp.swift ├── lib ├── cocoapods-embed-flutter.rb ├── cocoapods-embed-flutter │ ├── flutter.rb │ ├── flutter │ │ ├── dependency.rb │ │ ├── downloader.rb │ │ ├── external_sources.rb │ │ └── pubspec.rb │ ├── gem_version.rb │ ├── hooks.rb │ ├── hooks │ │ └── post_install.rb │ ├── source.rb │ └── src │ │ └── pub.rb └── cocoapods_plugin.rb └── spec ├── info_spec.rb └── spec_helper.rb /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [soumyamahunt] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 14 | -------------------------------------------------------------------------------- /.github/config/config.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const config = require('conventional-changelog-conventionalcommits'); 3 | 4 | module.exports = config({ 5 | "types": [ 6 | { type: 'feat', section: '🚀 Features' }, 7 | { type: 'fix', section: '🐛 Fixes' }, 8 | { type: 'perf', section: '🐎 Performance Improvements' }, 9 | { type: 'revert', section: '⏪ Reverts' }, 10 | { type: 'build', section: '🛠 Build System' }, 11 | { type: 'deps', section: '🛠 Dependency' }, 12 | { type: 'ci', section: '💡 Continuous Integration' }, 13 | { type: 'refactor', section: '🔥 Refactorings' }, 14 | { type: 'doc', section: '📚 Documentation' }, 15 | { type: 'docs', section: '📚 Documentation' }, 16 | { type: 'style', section: '💄 Styles' }, 17 | { type: 'test', section: '✅ Tests' }, 18 | { type: 'wip', hidden: true }, 19 | { type: 'chore', hidden: true }, 20 | ] 21 | }) -------------------------------------------------------------------------------- /.github/config/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "config", 3 | "version": "1.0.0", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "config", 9 | "version": "1.0.0", 10 | "license": "MIT", 11 | "dependencies": { 12 | "@actions/core": "1.10.0", 13 | "conventional-changelog-conventionalcommits": "^5.0.0", 14 | "semver": "^7.5.0" 15 | } 16 | }, 17 | "node_modules/@actions/core": { 18 | "version": "1.10.0", 19 | "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", 20 | "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", 21 | "dependencies": { 22 | "@actions/http-client": "^2.0.1", 23 | "uuid": "^8.3.2" 24 | } 25 | }, 26 | "node_modules/@actions/http-client": { 27 | "version": "2.0.1", 28 | "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz", 29 | "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==", 30 | "dependencies": { 31 | "tunnel": "^0.0.6" 32 | } 33 | }, 34 | "node_modules/array-ify": { 35 | "version": "1.0.0", 36 | "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", 37 | "integrity": "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=" 38 | }, 39 | "node_modules/compare-func": { 40 | "version": "2.0.0", 41 | "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", 42 | "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", 43 | "dependencies": { 44 | "array-ify": "^1.0.0", 45 | "dot-prop": "^5.1.0" 46 | } 47 | }, 48 | "node_modules/conventional-changelog-conventionalcommits": { 49 | "version": "5.0.0", 50 | "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-5.0.0.tgz", 51 | "integrity": "sha512-lCDbA+ZqVFQGUj7h9QBKoIpLhl8iihkO0nCTyRNzuXtcd7ubODpYB04IFy31JloiJgG0Uovu8ot8oxRzn7Nwtw==", 52 | "dependencies": { 53 | "compare-func": "^2.0.0", 54 | "lodash": "^4.17.15", 55 | "q": "^1.5.1" 56 | }, 57 | "engines": { 58 | "node": ">=10" 59 | } 60 | }, 61 | "node_modules/dot-prop": { 62 | "version": "5.3.0", 63 | "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", 64 | "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", 65 | "dependencies": { 66 | "is-obj": "^2.0.0" 67 | }, 68 | "engines": { 69 | "node": ">=8" 70 | } 71 | }, 72 | "node_modules/is-obj": { 73 | "version": "2.0.0", 74 | "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", 75 | "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", 76 | "engines": { 77 | "node": ">=8" 78 | } 79 | }, 80 | "node_modules/lodash": { 81 | "version": "4.17.21", 82 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", 83 | "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" 84 | }, 85 | "node_modules/lru-cache": { 86 | "version": "6.0.0", 87 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", 88 | "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", 89 | "dependencies": { 90 | "yallist": "^4.0.0" 91 | }, 92 | "engines": { 93 | "node": ">=10" 94 | } 95 | }, 96 | "node_modules/q": { 97 | "version": "1.5.1", 98 | "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", 99 | "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", 100 | "engines": { 101 | "node": ">=0.6.0", 102 | "teleport": ">=0.2.0" 103 | } 104 | }, 105 | "node_modules/semver": { 106 | "version": "7.5.0", 107 | "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz", 108 | "integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==", 109 | "dependencies": { 110 | "lru-cache": "^6.0.0" 111 | }, 112 | "bin": { 113 | "semver": "bin/semver.js" 114 | }, 115 | "engines": { 116 | "node": ">=10" 117 | } 118 | }, 119 | "node_modules/tunnel": { 120 | "version": "0.0.6", 121 | "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", 122 | "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", 123 | "engines": { 124 | "node": ">=0.6.11 <=0.7.0 || >=0.7.3" 125 | } 126 | }, 127 | "node_modules/uuid": { 128 | "version": "8.3.2", 129 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", 130 | "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", 131 | "bin": { 132 | "uuid": "dist/bin/uuid" 133 | } 134 | }, 135 | "node_modules/yallist": { 136 | "version": "4.0.0", 137 | "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", 138 | "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" 139 | } 140 | }, 141 | "dependencies": { 142 | "@actions/core": { 143 | "version": "1.10.0", 144 | "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", 145 | "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", 146 | "requires": { 147 | "@actions/http-client": "^2.0.1", 148 | "uuid": "^8.3.2" 149 | } 150 | }, 151 | "@actions/http-client": { 152 | "version": "2.0.1", 153 | "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz", 154 | "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==", 155 | "requires": { 156 | "tunnel": "^0.0.6" 157 | } 158 | }, 159 | "array-ify": { 160 | "version": "1.0.0", 161 | "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", 162 | "integrity": "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=" 163 | }, 164 | "compare-func": { 165 | "version": "2.0.0", 166 | "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", 167 | "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", 168 | "requires": { 169 | "array-ify": "^1.0.0", 170 | "dot-prop": "^5.1.0" 171 | } 172 | }, 173 | "conventional-changelog-conventionalcommits": { 174 | "version": "5.0.0", 175 | "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-5.0.0.tgz", 176 | "integrity": "sha512-lCDbA+ZqVFQGUj7h9QBKoIpLhl8iihkO0nCTyRNzuXtcd7ubODpYB04IFy31JloiJgG0Uovu8ot8oxRzn7Nwtw==", 177 | "requires": { 178 | "compare-func": "^2.0.0", 179 | "lodash": "^4.17.15", 180 | "q": "^1.5.1" 181 | } 182 | }, 183 | "dot-prop": { 184 | "version": "5.3.0", 185 | "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", 186 | "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", 187 | "requires": { 188 | "is-obj": "^2.0.0" 189 | } 190 | }, 191 | "is-obj": { 192 | "version": "2.0.0", 193 | "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", 194 | "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==" 195 | }, 196 | "lodash": { 197 | "version": "4.17.21", 198 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", 199 | "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" 200 | }, 201 | "lru-cache": { 202 | "version": "6.0.0", 203 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", 204 | "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", 205 | "requires": { 206 | "yallist": "^4.0.0" 207 | } 208 | }, 209 | "q": { 210 | "version": "1.5.1", 211 | "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", 212 | "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" 213 | }, 214 | "semver": { 215 | "version": "7.5.0", 216 | "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz", 217 | "integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==", 218 | "requires": { 219 | "lru-cache": "^6.0.0" 220 | } 221 | }, 222 | "tunnel": { 223 | "version": "0.0.6", 224 | "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", 225 | "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" 226 | }, 227 | "uuid": { 228 | "version": "8.3.2", 229 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", 230 | "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" 231 | }, 232 | "yallist": { 233 | "version": "4.0.0", 234 | "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", 235 | "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" 236 | } 237 | } 238 | } 239 | -------------------------------------------------------------------------------- /.github/config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "config", 3 | "version": "1.0.0", 4 | "description": "conventional-changelog-action hooks", 5 | "main": "config.js", 6 | "license": "MIT", 7 | "author": { 8 | "name": "Soumya Ranjan Mahunt", 9 | "email": "soumya.mahunt@gmail.com" 10 | }, 11 | "dependencies": { 12 | "@actions/core": "1.10.0", 13 | "conventional-changelog-conventionalcommits": "^5.0.0", 14 | "semver": "^7.5.0" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.github/config/pre_changelog_hook.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const fs = require('fs'); 3 | const semver = require('semver'); 4 | const core = require('@actions/core'); 5 | const childProcess = require("child_process"); 6 | 7 | exports.preVersionGeneration = (version) => { 8 | const { GITHUB_WORKSPACE } = process.env; 9 | core.info(`Computed version bump: ${version}`); 10 | 11 | const gem_info_file = path.join(GITHUB_WORKSPACE, 'lib/cocoapods-embed-flutter/gem_version.rb'); 12 | const gem_info = `${fs.readFileSync(gem_info_file)}`; 13 | core.info(`Current gem info: ${gem_info}`); 14 | 15 | currentVersion = gem_info.match(/VERSION\s*=\s'(.*)'/)[1]; 16 | core.info(`Current version: ${currentVersion}`); 17 | 18 | if (semver.lt(version, currentVersion)) { version = currentVersion; } 19 | core.info(`Final version: ${version}`); 20 | 21 | const new_gem_info = gem_info.replace(/VERSION\s*=\s*.*/g, `VERSION = '${version}'.freeze`); 22 | core.info(`Updated gem info: ${new_gem_info}`); 23 | fs.writeFileSync(gem_info_file, new_gem_info); 24 | 25 | const launchOption = { cwd: GITHUB_WORKSPACE }; 26 | childProcess.execSync('bundle config unset deployment', launchOption); 27 | childProcess.execSync('bundle install', launchOption); 28 | childProcess.execSync('bundle exec rake update --trace', launchOption); 29 | childProcess.execSync('bundle config deployment true', launchOption); 30 | return version; 31 | } 32 | 33 | exports.preTagGeneration = (tag) => { } -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: bundler 4 | directory: / 5 | insecure-external-code-execution: allow 6 | schedule: 7 | interval: weekly 8 | commit-message: 9 | prefix: 'deps: ' 10 | 11 | - package-ecosystem: github-actions 12 | directory: / 13 | schedule: 14 | interval: monthly 15 | commit-message: 16 | prefix: 'ci(Deps): ' 17 | 18 | - package-ecosystem: npm 19 | directory: .github/config 20 | schedule: 21 | interval: monthly 22 | commit-message: 23 | prefix: 'ci(Deps): ' -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | workflow_call: 5 | schedule: 6 | - cron: '0 0 * * *' 7 | 8 | concurrency: 9 | group: scan-${{ github.ref }} 10 | cancel-in-progress: true 11 | 12 | jobs: 13 | analyze: 14 | name: Analyze 15 | runs-on: ubuntu-latest 16 | permissions: 17 | actions: read 18 | contents: read 19 | security-events: write 20 | 21 | strategy: 22 | matrix: 23 | language: [ 'javascript', 'ruby' ] 24 | 25 | steps: 26 | - name: Checkout repository 27 | uses: actions/checkout@v3 28 | 29 | # Initializes the CodeQL tools for scanning. 30 | - name: Initialize CodeQL 31 | uses: github/codeql-action/init@v2 32 | with: 33 | languages: ${{ matrix.language }} 34 | 35 | - name: Perform CodeQL Analysis 36 | uses: github/codeql-action/analyze@v2 37 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI/CD 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | paths-ignore: 7 | - '*.md' 8 | pull_request: 9 | branches: [ main ] 10 | paths-ignore: 11 | - '*.md' 12 | workflow_dispatch: 13 | inputs: 14 | release: 15 | description: Create release 16 | required: false 17 | type: boolean 18 | 19 | env: 20 | RUBY_VER: 2.6 21 | 22 | concurrency: 23 | group: ci/cd-${{ github.ref }} 24 | cancel-in-progress: true 25 | 26 | jobs: 27 | analyze: 28 | name: Analyze 29 | if: github.event_name != 'workflow_dispatch' 30 | uses: ./.github/workflows/codeql-analysis.yml 31 | permissions: 32 | actions: read 33 | contents: read 34 | security-events: write 35 | 36 | ci: 37 | name: Run Tests 38 | runs-on: macos-latest 39 | outputs: 40 | release: ${{ steps.check_version_bump.outputs.release_type != '' }} 41 | 42 | steps: 43 | - name: Checkout repository 44 | uses: actions/checkout@v3 45 | 46 | - name: Setup Ruby 47 | uses: ruby/setup-ruby@v1 48 | with: 49 | ruby-version: ${{ env.RUBY_VER }} 50 | 51 | - name: Install dependencies 52 | run: | 53 | bundle config deployment true 54 | bundle install 55 | 56 | - name: Run tests 57 | run: bundle exec rake specs 58 | 59 | - name: Install Flutter 60 | uses: subosito/flutter-action@v2.10.0 61 | 62 | - name: Setup Flutter for ios 63 | run: | 64 | flutter precache --ios 65 | 66 | - name: Test example app 67 | run: bundle exec rake demo 68 | 69 | - name: Check version bump 70 | id: check_version_bump 71 | uses: mathieudutour/github-tag-action@v6.1 72 | with: 73 | github_token: ${{ github.token }} 74 | default_bump: false 75 | dry_run: true 76 | 77 | cd: 78 | name: Build and Publish 79 | if: (github.event_name == 'push' && needs.ci.outputs.release == 'true') || (github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'true') 80 | needs: [ci, analyze] 81 | runs-on: ubuntu-latest 82 | 83 | steps: 84 | - name: Checkout repository 85 | uses: actions/checkout@v3 86 | with: 87 | fetch-depth: 0 88 | 89 | - name: Setup node 90 | uses: actions/setup-node@v3 91 | with: 92 | node-version: '17' 93 | 94 | - name: Setup action config 95 | run: npm install 96 | working-directory: .github/config 97 | 98 | - name: Setup Ruby 99 | uses: ruby/setup-ruby@v1 100 | with: 101 | ruby-version: ${{ env.RUBY_VER }} 102 | 103 | - name: Install dependencies 104 | run: | 105 | bundle config deployment true 106 | bundle install 107 | 108 | - name: Conventional Changelog Action 109 | id: conventional_changelog 110 | uses: TriPSs/conventional-changelog-action@v3 111 | with: 112 | github-token: ${{ github.token }} 113 | git-message: 'chore(CHANGELOG): update for {version}' 114 | git-user-name: ${{ github.actor }} 115 | git-user-email: soumya.mahunt@gmail.com 116 | skip-version-file: true 117 | release-count: 0 118 | pre-changelog-generation: '.github/config/pre_changelog_hook.js' 119 | config-file-path: '.github/config/config.js' 120 | 121 | - name: Build gem 122 | if: steps.conventional_changelog.outputs.skipped == 'false' 123 | run: gem build *.gemspec 124 | 125 | - name: Publish to GitHub Package Registry 126 | if: steps.conventional_changelog.outputs.skipped == 'false' 127 | run: | 128 | mkdir -p $HOME/.gem 129 | touch $HOME/.gem/credentials 130 | chmod 0600 $HOME/.gem/credentials 131 | printf -- "---\n:github: Bearer ${GITHUB_TOKEN}\n" > $HOME/.gem/credentials 132 | gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem 133 | env: 134 | GITHUB_TOKEN: ${{ github.token }} 135 | OWNER: ${{ github.repository_owner }} 136 | 137 | - name: Publish to RubyGems 138 | if: steps.conventional_changelog.outputs.skipped == 'false' 139 | run: | 140 | mkdir -p $HOME/.gem 141 | touch $HOME/.gem/credentials 142 | chmod 0600 $HOME/.gem/credentials 143 | printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials 144 | gem push *.gem 145 | env: 146 | GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }} 147 | 148 | - name: Create GitHub Release 149 | if: steps.conventional_changelog.outputs.skipped == 'false' 150 | uses: ncipollo/release-action@v1 151 | with: 152 | token: ${{ github.token }} 153 | tag: ${{ steps.conventional_changelog.outputs.tag }} 154 | body: ${{ steps.conventional_changelog.outputs.changelog }} 155 | artifacts: '*.gem' 156 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## User settings 6 | xcuserdata/ 7 | 8 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 9 | *.xcscmblueprint 10 | *.xccheckout 11 | 12 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 13 | build/ 14 | vendor/ 15 | DerivedData/ 16 | *.moved-aside 17 | *.pbxuser 18 | !default.pbxuser 19 | *.mode1v3 20 | !default.mode1v3 21 | *.mode2v3 22 | !default.mode2v3 23 | *.perspectivev3 24 | !default.perspectivev3 25 | # OS generated files # 26 | ###################### 27 | .DS_Store 28 | .DS_Store? 29 | ._* 30 | .Spotlight-V100 31 | .Trashes 32 | ehthumbs.db 33 | Thumbs.db 34 | 35 | # CocoaPods 36 | # We recommend against adding the Pods directory to your .gitignore. However 37 | # you should judge for yourself, the pros and cons are mentioned at: 38 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 39 | Pods/ 40 | contents.xcworkspacedata 41 | IDEWorkspaceChecks.plist 42 | 43 | # Miscellaneous 44 | *.class 45 | *.log 46 | *.pyc 47 | *.swp 48 | .DS_Store 49 | .atom/ 50 | .buildlog/ 51 | .history 52 | .svn/ 53 | 54 | # IntelliJ related 55 | *.ipr 56 | *.iws 57 | .idea/ 58 | 59 | # The .vscode folder contains launch configuration and tasks you configure in 60 | # VS Code which you may wish to be included in version control, so this line 61 | # is commented out by default. 62 | #.vscode/ 63 | 64 | # Flutter/Dart/Pub related 65 | **/doc/api/ 66 | .dart_tool/ 67 | .flutter-plugins 68 | .flutter-plugins-dependencies 69 | .packages 70 | .pub-cache/ 71 | .pub/ 72 | build/ 73 | 74 | # Android related 75 | **/android/**/gradle-wrapper.jar 76 | **/android/.gradle 77 | **/android/captures/ 78 | **/android/gradlew 79 | **/android/gradlew.bat 80 | **/android/local.properties 81 | **/android/**/GeneratedPluginRegistrant.java 82 | 83 | # iOS/XCode related 84 | **/ios/**/*.mode1v3 85 | **/ios/**/*.mode2v3 86 | **/ios/**/*.moved-aside 87 | **/ios/**/*.pbxuser 88 | **/ios/**/*.perspectivev3 89 | **/ios/**/*sync/ 90 | **/ios/**/.sconsign.dblite 91 | **/ios/**/.tags* 92 | **/ios/**/.vagrant/ 93 | **/ios/**/DerivedData/ 94 | **/ios/**/Icon? 95 | **/ios/**/Pods/ 96 | **/ios/**/.symlinks/ 97 | **/ios/**/profile 98 | **/ios/**/xcuserdata 99 | **/ios/.generated/ 100 | **/ios/Flutter/App.framework 101 | **/ios/Flutter/Flutter.framework 102 | **/ios/Flutter/Flutter.podspec 103 | **/ios/Flutter/Generated.xcconfig 104 | **/ios/Flutter/ephemeral 105 | **/ios/Flutter/app.flx 106 | **/ios/Flutter/app.zip 107 | **/ios/Flutter/flutter_assets/ 108 | **/ios/Flutter/flutter_export_environment.sh 109 | **/ios/ServiceDefinitions.json 110 | **/ios/Runner/GeneratedPluginRegistrant.* 111 | 112 | # Exceptions to above rules. 113 | !**/ios/**/default.mode1v3 114 | !**/ios/**/default.mode2v3 115 | !**/ios/**/default.pbxuser 116 | !**/ios/**/default.perspectivev3 117 | 118 | # Ruby related 119 | *.gem 120 | *.rbc 121 | /.config 122 | /coverage/ 123 | /InstalledFiles 124 | /pkg/ 125 | /spec/reports/ 126 | /spec/examples.txt 127 | /test/tmp/ 128 | /test/version_tmp/ 129 | /tmp/ 130 | 131 | # Used by dotenv library to load environment variables. 132 | # .env 133 | 134 | # Ignore Byebug command history file. 135 | .byebug_history 136 | 137 | ## Specific to RubyMotion: 138 | .dat* 139 | .repl_history 140 | build/ 141 | *.bridgesupport 142 | build-iPhoneOS/ 143 | build-iPhoneSimulator/ 144 | 145 | ## Specific to RubyMotion (use of CocoaPods): 146 | # 147 | # We recommend against adding the Pods directory to your .gitignore. However 148 | # you should judge for yourself, the pros and cons are mentioned at: 149 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 150 | # 151 | # vendor/Pods/ 152 | 153 | ## Documentation cache and generated files: 154 | /.yardoc/ 155 | /_yardoc/ 156 | /doc/ 157 | /rdoc/ 158 | 159 | ## Environment normalization: 160 | /.bundle/ 161 | /vendor/bundle 162 | /lib/bundler/man/ 163 | 164 | # for a library or gem, you might want to ignore these files since the code is 165 | # intended to run in multiple environments; otherwise, check them in: 166 | # Gemfile.lock 167 | # .ruby-version 168 | # .ruby-gemset 169 | 170 | # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: 171 | .rvmrc 172 | 173 | # Used by RuboCop. Remote config files pulled in from inherit_from directive. 174 | # .rubocop-https?--* 175 | 176 | # Node.js Tools for Visual Studio 177 | .ntvs_analysis.dat 178 | node_modules/ -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "castwide.solargraph", 4 | "rebornix.ruby" 5 | ] 6 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ### [0.6.1](https://github.com/DartBuild/cocoapods-embed-flutter/compare/v0.6.0...v0.6.1) (2022-05-03) 2 | 3 | 4 | ### 🛠 Dependency 5 | 6 | * bump cocoapods-downloader from 1.5.1 to 1.6.3 ([#5](https://github.com/DartBuild/cocoapods-embed-flutter/issues/5)) ([8067f06](https://github.com/DartBuild/cocoapods-embed-flutter/commit/8067f062ab268fcc588e60c5cf54c3fe4da1d3e2)) 7 | * bump nokogiri from 1.13.3 to 1.13.4 ([#7](https://github.com/DartBuild/cocoapods-embed-flutter/issues/7)) ([975638e](https://github.com/DartBuild/cocoapods-embed-flutter/commit/975638ecda2fc65f4141d1e0a37f08a775692984)) 8 | 9 | 10 | ### 💡 Continuous Integration 11 | 12 | * add codeql scanning ([3120c44](https://github.com/DartBuild/cocoapods-embed-flutter/commit/3120c446adf3bce9b80fe07a0d57ca79d7adfe7e)) 13 | * **Deps:** bump @actions/core from 1.6.0 to 1.7.0 in /.github/config ([#8](https://github.com/DartBuild/cocoapods-embed-flutter/issues/8)) ([a3861ad](https://github.com/DartBuild/cocoapods-embed-flutter/commit/a3861ad7223c5d9a2021b15359d158a7c9ea2705)) 14 | * **Deps:** bump semver from 7.3.5 to 7.3.7 in /.github/config ([#9](https://github.com/DartBuild/cocoapods-embed-flutter/issues/9)) ([36f2599](https://github.com/DartBuild/cocoapods-embed-flutter/commit/36f2599074c2a4e13bbd07680cc0cb208fe7ee97)) 15 | * **Deps:** bump subosito/flutter-action from 2.3.0 to 2.4.0 ([#10](https://github.com/DartBuild/cocoapods-embed-flutter/issues/10)) ([2e6c1c1](https://github.com/DartBuild/cocoapods-embed-flutter/commit/2e6c1c108bc4dc44e25844d13fd0bb86639bba2e)) 16 | * **Runners:** added self hosted macos runner ([3371c29](https://github.com/DartBuild/cocoapods-embed-flutter/commit/3371c294ea34f2fa123e4ebb6ae368311e5dfb8b)) 17 | 18 | 19 | ### 🐎 Performance Improvements 20 | 21 | * allow concurrent `flutter pub get` ([ef5bc8a](https://github.com/DartBuild/cocoapods-embed-flutter/commit/ef5bc8a7daa0eada810210e481f0be708182192c)) 22 | 23 | ## [0.6.0](https://github.com/DartBuild/cocoapods-embed-flutter/compare/v0.5.3...v0.6.0) (2022-03-27) 24 | 25 | 26 | ### 📚 Documentation 27 | 28 | * **README:** add pub.dev limitation ([f42de7c](https://github.com/DartBuild/cocoapods-embed-flutter/commit/f42de7c908d65661bb12e8becc6fc6941295d19a)) 29 | 30 | 31 | ### 🛠 Dependency 32 | 33 | * bump cocoapods from 1.11.2 to 1.11.3 ([#4](https://github.com/DartBuild/cocoapods-embed-flutter/issues/4)) ([8cec1cb](https://github.com/DartBuild/cocoapods-embed-flutter/commit/8cec1cbe4c18dd20d155d5b1b8824ae7910a11c3)) 34 | 35 | 36 | ### 💄 Styles 37 | 38 | * add vscode extensions recommendation ([db4bdb5](https://github.com/DartBuild/cocoapods-embed-flutter/commit/db4bdb58765851cabfdf16254678301b149faceb)) 39 | 40 | 41 | ### 🚀 Features 42 | 43 | * allow specifying different path for remote sources ([56178ed](https://github.com/DartBuild/cocoapods-embed-flutter/commit/56178ed645a476e19b77377c246ce90de582b5ef)) 44 | 45 | ### [0.5.3](https://github.com/DartBuild/cocoapods-embed-flutter/compare/v0.5.2...v0.5.3) (2022-03-18) 46 | 47 | 48 | ### 📚 Documentation 49 | 50 | * **README:** add limitations ([8830ead](https://github.com/DartBuild/cocoapods-embed-flutter/commit/8830eadfbb46ddbce83a2bf329bc04fa3cfe2583)) 51 | 52 | ### [0.5.2](https://github.com/DartBuild/cocoapods-embed-flutter/compare/v0.5.1...v0.5.2) (2022-03-12) 53 | 54 | 55 | ### 📚 Documentation 56 | 57 | * add helpful links and badges ([8fb5253](https://github.com/DartBuild/cocoapods-embed-flutter/commit/8fb52531d66782525ae10a36bd7c1a5a062c02a4)) 58 | 59 | 60 | ### 💡 Continuous Integration 61 | 62 | * **Deps:** bump actions/checkout from 2 to 3 ([#2](https://github.com/DartBuild/cocoapods-embed-flutter/issues/2)) ([7fddfd6](https://github.com/DartBuild/cocoapods-embed-flutter/commit/7fddfd663a74e6390cddcee979b211e55daf18bb)) 63 | * **Deps:** bump actions/setup-node from 2 to 3 ([#3](https://github.com/DartBuild/cocoapods-embed-flutter/issues/3)) ([0af3476](https://github.com/DartBuild/cocoapods-embed-flutter/commit/0af34765e384d87fc257a9ddef2015faff393bad)) 64 | 65 | ### [0.5.1](https://github.com/DartBuild/cocoapods-embed-flutter/compare/v0.5.0...v0.5.1) (2022-03-11) 66 | 67 | 68 | ### 📚 Documentation 69 | 70 | * add code documentation ([dd8d3da](https://github.com/DartBuild/cocoapods-embed-flutter/commit/dd8d3dafc3da6d68fa365d5580e89fc460cf9d94)) 71 | 72 | ## [0.5.0](https://github.com/DartBuild/cocoapods-embed-flutter/compare/1ad9f80188b2fa296933af35e6902ffcd6db001e...v0.5.0) (2022-03-11) 73 | 74 | 75 | ### 🚀 Features 76 | 77 | * add all remotes supported by `cocoapods-downloader` ([e01ea82](https://github.com/DartBuild/cocoapods-embed-flutter/commit/e01ea8212d71b10a78390c187b5e8f351a09114b)) 78 | * allow local flutter module to be declared dependency ([1ad9f80](https://github.com/DartBuild/cocoapods-embed-flutter/commit/1ad9f80188b2fa296933af35e6902ffcd6db001e)) 79 | 80 | 81 | ### ✅ Tests 82 | 83 | * add app info tests ([269cb54](https://github.com/DartBuild/cocoapods-embed-flutter/commit/269cb5439c2a6912346187b2612de6b38345b738)) 84 | 85 | 86 | ### 💡 Continuous Integration 87 | 88 | * add dependabot config ([67099bd](https://github.com/DartBuild/cocoapods-embed-flutter/commit/67099bd490fbce0879e4aa6ddd93839847ff7e87)) 89 | * add flutter setup task ([d5aeda3](https://github.com/DartBuild/cocoapods-embed-flutter/commit/d5aeda30817f81ed6ef2f1e9e21f8e2b8f415e20)) 90 | * add publish to cocoapods repo task ([8bbac4d](https://github.com/DartBuild/cocoapods-embed-flutter/commit/8bbac4d24ed5a1e862a2531067aa8a62c5072849)) 91 | * fix bundle install on older macos ([70522ea](https://github.com/DartBuild/cocoapods-embed-flutter/commit/70522eaa46a07c872e727c4f6c774d0444d516cc)) 92 | * fix bundler error on linux ([a18435a](https://github.com/DartBuild/cocoapods-embed-flutter/commit/a18435a4efca56e62c70367b810fe1dc48cce5cf)) 93 | * fix depandabot config spec violation ([7846c67](https://github.com/DartBuild/cocoapods-embed-flutter/commit/7846c67856a1ec7df92275ae887a80ba3413f4d8)) 94 | * fix pod install ([61954c9](https://github.com/DartBuild/cocoapods-embed-flutter/commit/61954c912c6609a375920fccf8bbbf2d6aaa5e0e)) 95 | * setup CI/CD pipeline ([3e20bc9](https://github.com/DartBuild/cocoapods-embed-flutter/commit/3e20bc9d41be80b3a95077e1c7df8e6f0f83d6b7)) 96 | * setup flutter for ios ([d76deb2](https://github.com/DartBuild/cocoapods-embed-flutter/commit/d76deb220e3c0e60303b1b5676bbac24e7dc407f)) 97 | 98 | 99 | ### 📚 Documentation 100 | 101 | * add code level documentation ([f3c04ed](https://github.com/DartBuild/cocoapods-embed-flutter/commit/f3c04ed6fddab8901511530014282006beb11e8f)) 102 | * **README:** add usage details ([52852ae](https://github.com/DartBuild/cocoapods-embed-flutter/commit/52852aed76005285a8059bd1adb580a169d7463f)) 103 | 104 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | - Using welcoming and inclusive language 18 | - Being respectful of differing viewpoints and experiences 19 | - Gracefully accepting constructive criticism 20 | - Focusing on what is best for the community 21 | - Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | - The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | - Trolling, insulting/derogatory comments, and personal or political attacks 28 | - Public or private harassment 29 | - Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | - Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at soumya.mahunt@gmail.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Specify your gem's dependencies in cocoapods-embed-flutter.gemspec 4 | gemspec 5 | 6 | group :development do 7 | gem 'mocha' 8 | gem 'bacon' 9 | gem 'mocha-on-bacon' 10 | gem 'prettybacon' 11 | gem 'solargraph' 12 | gem 'github_api' 13 | end 14 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: . 3 | specs: 4 | cocoapods-embed-flutter (0.6.1) 5 | cocoapods 6 | concurrent-ruby 7 | fileutils 8 | yaml 9 | 10 | GEM 11 | remote: https://rubygems.org/ 12 | specs: 13 | CFPropertyList (3.0.6) 14 | rexml 15 | activesupport (6.1.7.3) 16 | concurrent-ruby (~> 1.0, >= 1.0.2) 17 | i18n (>= 1.6, < 2) 18 | minitest (>= 5.1) 19 | tzinfo (~> 2.0) 20 | zeitwerk (~> 2.3) 21 | addressable (2.8.4) 22 | public_suffix (>= 2.0.2, < 6.0) 23 | algoliasearch (1.27.5) 24 | httpclient (~> 2.8, >= 2.8.3) 25 | json (>= 1.5.1) 26 | ast (2.4.2) 27 | atomos (0.1.3) 28 | backport (1.2.0) 29 | bacon (1.2.0) 30 | benchmark (0.2.1) 31 | claide (1.1.0) 32 | cocoapods (1.12.1) 33 | addressable (~> 2.8) 34 | claide (>= 1.0.2, < 2.0) 35 | cocoapods-core (= 1.12.1) 36 | cocoapods-deintegrate (>= 1.0.3, < 2.0) 37 | cocoapods-downloader (>= 1.6.0, < 2.0) 38 | cocoapods-plugins (>= 1.0.0, < 2.0) 39 | cocoapods-search (>= 1.0.0, < 2.0) 40 | cocoapods-trunk (>= 1.6.0, < 2.0) 41 | cocoapods-try (>= 1.1.0, < 2.0) 42 | colored2 (~> 3.1) 43 | escape (~> 0.0.4) 44 | fourflusher (>= 2.3.0, < 3.0) 45 | gh_inspector (~> 1.0) 46 | molinillo (~> 0.8.0) 47 | nap (~> 1.0) 48 | ruby-macho (>= 2.3.0, < 3.0) 49 | xcodeproj (>= 1.21.0, < 2.0) 50 | cocoapods-core (1.12.1) 51 | activesupport (>= 5.0, < 8) 52 | addressable (~> 2.8) 53 | algoliasearch (~> 1.0) 54 | concurrent-ruby (~> 1.1) 55 | fuzzy_match (~> 2.0.4) 56 | nap (~> 1.0) 57 | netrc (~> 0.11) 58 | public_suffix (~> 4.0) 59 | typhoeus (~> 1.0) 60 | cocoapods-deintegrate (1.0.5) 61 | cocoapods-downloader (1.6.3) 62 | cocoapods-plugins (1.0.0) 63 | nap 64 | cocoapods-search (1.0.1) 65 | cocoapods-trunk (1.6.0) 66 | nap (>= 0.8, < 2.0) 67 | netrc (~> 0.11) 68 | cocoapods-try (1.2.0) 69 | colored2 (3.1.2) 70 | concurrent-ruby (1.2.2) 71 | descendants_tracker (0.0.4) 72 | thread_safe (~> 0.3, >= 0.3.1) 73 | diff-lcs (1.5.0) 74 | e2mmap (0.1.0) 75 | escape (0.0.4) 76 | ethon (0.16.0) 77 | ffi (>= 1.15.0) 78 | faraday (1.10.0) 79 | faraday-em_http (~> 1.0) 80 | faraday-em_synchrony (~> 1.0) 81 | faraday-excon (~> 1.1) 82 | faraday-httpclient (~> 1.0) 83 | faraday-multipart (~> 1.0) 84 | faraday-net_http (~> 1.0) 85 | faraday-net_http_persistent (~> 1.0) 86 | faraday-patron (~> 1.0) 87 | faraday-rack (~> 1.0) 88 | faraday-retry (~> 1.0) 89 | ruby2_keywords (>= 0.0.4) 90 | faraday-em_http (1.0.0) 91 | faraday-em_synchrony (1.0.0) 92 | faraday-excon (1.1.0) 93 | faraday-httpclient (1.0.1) 94 | faraday-multipart (1.0.3) 95 | multipart-post (>= 1.2, < 3) 96 | faraday-net_http (1.0.1) 97 | faraday-net_http_persistent (1.2.0) 98 | faraday-patron (1.0.0) 99 | faraday-rack (1.0.0) 100 | faraday-retry (1.0.3) 101 | ffi (1.15.5) 102 | fileutils (1.7.1) 103 | fourflusher (2.3.1) 104 | fuzzy_match (2.0.4) 105 | gh_inspector (1.1.3) 106 | github_api (0.19.0) 107 | addressable (~> 2.4) 108 | descendants_tracker (~> 0.0.4) 109 | faraday (>= 0.8, < 2) 110 | hashie (~> 3.5, >= 3.5.2) 111 | oauth2 (~> 1.0) 112 | hashie (3.6.0) 113 | httpclient (2.8.3) 114 | i18n (1.12.0) 115 | concurrent-ruby (~> 1.0) 116 | jaro_winkler (1.5.6) 117 | json (2.6.3) 118 | jwt (2.3.0) 119 | kramdown (2.4.0) 120 | rexml 121 | kramdown-parser-gfm (1.1.0) 122 | kramdown (~> 2.0) 123 | minitest (5.18.0) 124 | mocha (2.0.2) 125 | ruby2_keywords (>= 0.0.5) 126 | mocha-on-bacon (0.2.3) 127 | mocha (>= 0.13.0) 128 | molinillo (0.8.0) 129 | multi_json (1.15.0) 130 | multi_xml (0.6.0) 131 | multipart-post (2.1.1) 132 | nanaimo (0.3.0) 133 | nap (1.1.0) 134 | netrc (0.11.0) 135 | nokogiri (1.13.10-arm64-darwin) 136 | racc (~> 1.4) 137 | nokogiri (1.13.10-x86_64-darwin) 138 | racc (~> 1.4) 139 | nokogiri (1.13.10-x86_64-linux) 140 | racc (~> 1.4) 141 | oauth2 (1.4.11) 142 | faraday (>= 0.17.3, < 3.0) 143 | jwt (>= 1.0, < 3.0) 144 | multi_json (~> 1.3) 145 | multi_xml (~> 0.5) 146 | rack (>= 1.2, < 4) 147 | parallel (1.23.0) 148 | parser (3.2.2.1) 149 | ast (~> 2.4.1) 150 | prettybacon (0.0.2) 151 | bacon (~> 1.2) 152 | public_suffix (4.0.7) 153 | racc (1.6.2) 154 | rack (3.0.6.1) 155 | rainbow (3.1.1) 156 | rake (13.0.6) 157 | rbs (2.8.4) 158 | regexp_parser (2.8.0) 159 | reverse_markdown (2.1.1) 160 | nokogiri 161 | rexml (3.2.5) 162 | rubocop (1.50.2) 163 | json (~> 2.3) 164 | parallel (~> 1.10) 165 | parser (>= 3.2.0.0) 166 | rainbow (>= 2.2.2, < 4.0) 167 | regexp_parser (>= 1.8, < 3.0) 168 | rexml (>= 3.2.5, < 4.0) 169 | rubocop-ast (>= 1.28.0, < 2.0) 170 | ruby-progressbar (~> 1.7) 171 | unicode-display_width (>= 2.4.0, < 3.0) 172 | rubocop-ast (1.29.0) 173 | parser (>= 3.2.1.0) 174 | ruby-macho (2.5.1) 175 | ruby-progressbar (1.13.0) 176 | ruby2_keywords (0.0.5) 177 | solargraph (0.49.0) 178 | backport (~> 1.2) 179 | benchmark 180 | bundler (~> 2.0) 181 | diff-lcs (~> 1.4) 182 | e2mmap 183 | jaro_winkler (~> 1.5) 184 | kramdown (~> 2.3) 185 | kramdown-parser-gfm (~> 1.1) 186 | parser (~> 3.0) 187 | rbs (~> 2.0) 188 | reverse_markdown (~> 2.0) 189 | rubocop (~> 1.38) 190 | thor (~> 1.0) 191 | tilt (~> 2.0) 192 | yard (~> 0.9, >= 0.9.24) 193 | thor (1.2.2) 194 | thread_safe (0.3.6) 195 | tilt (2.1.0) 196 | typhoeus (1.4.0) 197 | ethon (>= 0.9.0) 198 | tzinfo (2.0.6) 199 | concurrent-ruby (~> 1.0) 200 | unicode-display_width (2.4.2) 201 | xcodeproj (1.22.0) 202 | CFPropertyList (>= 2.3.3, < 4.0) 203 | atomos (~> 0.1.3) 204 | claide (>= 1.0.2, < 2.0) 205 | colored2 (~> 3.1) 206 | nanaimo (~> 0.3.0) 207 | rexml (~> 3.2.4) 208 | yaml (0.2.1) 209 | yard (0.9.34) 210 | zeitwerk (2.6.7) 211 | 212 | PLATFORMS 213 | universal-darwin-21 214 | x86_64-darwin-19 215 | x86_64-linux 216 | 217 | DEPENDENCIES 218 | bacon 219 | bundler 220 | cocoapods-embed-flutter! 221 | github_api 222 | mocha 223 | mocha-on-bacon 224 | prettybacon 225 | rake 226 | solargraph 227 | 228 | BUNDLED WITH 229 | 2.3.7 230 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 DartBuild 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CocoaPods Embed Flutter 2 | 3 | [![CI/CD](https://github.com/DartBuild/cocoapods-embed-flutter/actions/workflows/main.yml/badge.svg?branch=main&event=push)](https://github.com/DartBuild/cocoapods-embed-flutter/actions/workflows/main.yml) 4 | [![Gem Version](https://badge.fury.io/rb/cocoapods-embed-flutter.svg)](http://badge.fury.io/rb/cocoapods-embed-flutter) 5 | [![Maintainability](https://api.codeclimate.com/v1/badges/3cb2cbd6e1c2b600e1f5/maintainability)](https://codeclimate.com/github/DartBuild/cocoapods-embed-flutter/maintainability) 6 | [![CodeQL](https://github.com/DartBuild/cocoapods-embed-flutter/actions/workflows/codeql-analysis.yml/badge.svg?branch=main&event=schedule)](https://github.com/DartBuild/cocoapods-embed-flutter/actions/workflows/codeql-analysis.yml) 7 | 8 | Straight forward way of declaring flutter modules as dependency for targets, just like cocoapods does with pods. 9 | 10 | ## Installation 11 | 12 | ### Install using command line. 13 | ```bash 14 | $ [sudo] gem install cocoapods-embed-flutter 15 | ``` 16 | 17 | ### Or add this to your `Gemfile`. 18 | ```rb 19 | gem 'cocoapods-embed-flutter' 20 | ``` 21 | ## Usage 22 | 23 | In your host project `Podfile`, write the below line before any target definition 24 | ```rb 25 | plugin 'cocoapods-embed-flutter' 26 | ``` 27 | 28 | ### Embedding module from a local path. 29 | 30 | ```rb 31 | pub 'flutter_module', :path => '../' 32 | ``` 33 | 34 | 35 | *`:path` can be path pointing to `pubspec.yaml` or to the directory containing `pubspec.yaml` or to the directory containg flutter module.* 36 | 37 | ### Embedding module from a repository. 38 | 39 | ```rb 40 | pub 'flutter_module', :git => 'https://github.com/gowalla/flutter_module.git', :branch => 'dev' 41 | pub 'flutter_module', :git => 'https://github.com/gowalla/flutter_module.git', :tag => '0.7.0' 42 | pub 'flutter_module', :git => 'https://github.com/gowalla/flutter_module.git', :commit => '082f8319af' 43 | ``` 44 | 45 | *flutter module project should be at the root of repository, if that's not the case add additional `:path` attribute for relative path to flutter project in repository. `:path` follows [these](#path_desc) restictions.* 46 | 47 | ```rb 48 | pub 'flutter_module', :git => 'https://github.com/gowalla/flutter_module.git', :tag => '0.7.0', :path => 'relative path/to/project' 49 | ``` 50 | 51 | ## Limitations 52 | 53 | - Modules hosted in [pub.dev](https://pub.dev/) are not supported, only local modules and modules in remote sources like git are supported. 54 | - You won't be able to add more than one flutter module to a single target. Currently flutter only supports one module per target. 55 | - No caching is done for external sources, every time you run `pod install` flutter module will be downloaded each time. 56 | 57 | ## Links 58 | 59 | | Link | Description | 60 | | :----- | :------ | 61 | [Gem page](https://rubygems.org/gems/cocoapods-embed-flutter) | Official Ruby Gems page. 62 | [Code docs](https://www.rubydoc.info/gems/cocoapods-embed-flutter) | Generated code documentation. 63 | [Changelog](https://github.com/DartBuild/cocoapods-embed-flutter/blob/main/CHANGELOG.md) | See the changes introduced in each version. 64 | [Code of Conduct](CODE_OF_CONDUCT.md) | Find out the standards we hold ourselves to. 65 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'bundler/gem_tasks' 2 | 3 | def specs(dir) 4 | FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ') 5 | end 6 | 7 | def setup_project(pod_install = false) 8 | system('bundle install', exception: true) 9 | Bundler.with_unbundled_env do 10 | Dir.chdir('example/ios_app') do |path| 11 | system('bundle install', exception: true) 12 | system('bundle exec pod install', exception: true) if pod_install 13 | end 14 | end 15 | end 16 | 17 | desc 'Runs all the specs' 18 | task :specs do 19 | sh "bundle exec bacon #{specs('**')}" 20 | end 21 | 22 | desc 'Setup example project' 23 | task :demo do 24 | setup_project(true) 25 | end 26 | 27 | desc 'Update lock files' 28 | task :update do 29 | setup_project 30 | end 31 | 32 | desc 'Publish to cocoapods plugins if not present' 33 | task :publish do 34 | require 'rubygems' 35 | gem = Gem::Specification::load(Dir['*.gemspec'].first) 36 | 37 | require 'cocoapods' 38 | require 'pod/command/plugins_helper' 39 | known_plugins = Pod::Command::PluginsHelper.known_plugins 40 | return if known_plugins.one? { |plugin| plugin['gem'] == gem.name } 41 | 42 | require 'github_api' 43 | return if Github.search.issues( 44 | q: "#{gem.name} user:CocoaPods repo:CocoaPods/cocoapods-plugins in:title" 45 | ).items.count > 0 46 | system('pod plugins publish', exception: true) 47 | end 48 | 49 | task :default => :specs 50 | 51 | -------------------------------------------------------------------------------- /cocoapods-embed-flutter.gemspec: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | lib = File.expand_path('../lib', __FILE__) 3 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 4 | require 'cocoapods-embed-flutter/gem_version.rb' 5 | 6 | Gem::Specification.new do |spec| 7 | repo = 'DartBuild/cocoapods-embed-flutter' 8 | github = 'https://github.com' 9 | repo_url = "#{github}/#{repo}" 10 | doc_url = 'https://www.rubydoc.info/gems/cocoapods-embed-flutter' 11 | 12 | spec.name = 'cocoapods-embed-flutter' 13 | spec.version = CocoapodsEmbedFlutter::VERSION 14 | spec.homepage = repo_url 15 | spec.license = 'MIT' 16 | spec.authors = ['Soumya Ranjan Mahunt'] 17 | spec.email = ['soumya.mahunt@gmail.com'] 18 | spec.summary = %q{Embed flutter modules in iOS projects.} 19 | spec.description = <<-EOF 20 | Straight forward way of declaring flutter modules as dependency for targets, 21 | just like cocoapods does with pods. 22 | EOF 23 | 24 | spec.files = `git ls-files`.split($/).grep_v(%r{^(example|.github)/}) 25 | spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } 26 | spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) 27 | spec.require_paths = ['lib'] 28 | 29 | spec.add_runtime_dependency 'yaml' 30 | spec.add_runtime_dependency 'fileutils' 31 | spec.add_runtime_dependency 'cocoapods' 32 | spec.add_runtime_dependency 'concurrent-ruby' 33 | 34 | spec.add_development_dependency 'bundler' 35 | spec.add_development_dependency 'rake' 36 | 37 | spec.required_ruby_version = '>= 2.6' 38 | spec.metadata = { 39 | 'bug_tracker_uri' => "#{repo_url}/issues", 40 | 'changelog_uri' => "#{repo_url}/blob/v#{spec.version}/CHANGELOG.md", 41 | 'documentation_uri' => "#{doc_url}/#{spec.version}", 42 | 'source_code_uri' => "#{repo_url}/tree/v#{spec.version}", 43 | 'github_repo' => "git@github.com:#{repo}.git", 44 | 'funding_uri' => "#{github}/sponsors/soumyamahunt" 45 | } 46 | end 47 | -------------------------------------------------------------------------------- /example/flutter_module/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | .idea/ 8 | .vagrant/ 9 | .sconsign.dblite 10 | .svn/ 11 | 12 | *.swp 13 | profile 14 | 15 | DerivedData/ 16 | 17 | .generated/ 18 | 19 | *.pbxuser 20 | *.mode1v3 21 | *.mode2v3 22 | *.perspectivev3 23 | 24 | !default.pbxuser 25 | !default.mode1v3 26 | !default.mode2v3 27 | !default.perspectivev3 28 | 29 | xcuserdata 30 | 31 | *.moved-aside 32 | 33 | *.pyc 34 | *sync/ 35 | Icon? 36 | .tags* 37 | 38 | build/ 39 | .android/ 40 | .ios/ 41 | .flutter-plugins 42 | .flutter-plugins-dependencies 43 | 44 | # Symbolication related 45 | app.*.symbols 46 | 47 | # Obfuscation related 48 | app.*.map.json 49 | -------------------------------------------------------------------------------- /example/flutter_module/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 097d3313d8e2c7f901932d63e537c1acefb87800 8 | channel: stable 9 | 10 | project_type: module 11 | -------------------------------------------------------------------------------- /example/flutter_module/README.md: -------------------------------------------------------------------------------- 1 | # flutter_module 2 | 3 | A new flutter module project. 4 | 5 | ## Getting Started 6 | 7 | For help getting started with Flutter, view our online 8 | [documentation](https://flutter.dev/). 9 | 10 | For instructions integrating Flutter modules to your existing applications, 11 | see the [add-to-app documentation](https://flutter.dev/docs/development/add-to-app). 12 | -------------------------------------------------------------------------------- /example/flutter_module/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | # Additional information about this file can be found at 4 | # https://dart.dev/guides/language/analysis-options 5 | -------------------------------------------------------------------------------- /example/flutter_module/flutter_module.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /example/flutter_module/flutter_module_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /example/flutter_module/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | void main() => runApp(const MyApp()); 4 | 5 | class MyApp extends StatelessWidget { 6 | const MyApp({Key? key}) : super(key: key); 7 | 8 | // This widget is the root of your application. 9 | @override 10 | Widget build(BuildContext context) { 11 | return MaterialApp( 12 | title: 'Flutter Demo', 13 | theme: ThemeData( 14 | // This is the theme of your application. 15 | // 16 | // Try running your application with "flutter run". You'll see the 17 | // application has a blue toolbar. Then, without quitting the app, try 18 | // changing the primarySwatch below to Colors.green and then invoke 19 | // "hot reload" (press "r" in the console where you ran "flutter run", 20 | // or press Run > Flutter Hot Reload in a Flutter IDE). Notice that the 21 | // counter didn't reset back to zero; the application is not restarted. 22 | primarySwatch: Colors.blue, 23 | ), 24 | home: const MyHomePage(title: 'Flutter Demo Home Page'), 25 | ); 26 | } 27 | } 28 | 29 | class MyHomePage extends StatefulWidget { 30 | const MyHomePage({Key? key, required this.title}) : super(key: key); 31 | 32 | // This widget is the home page of your application. It is stateful, meaning 33 | // that it has a State object (defined below) that contains fields that affect 34 | // how it looks. 35 | 36 | // This class is the configuration for the state. It holds the values (in this 37 | // case the title) provided by the parent (in this case the App widget) and 38 | // used by the build method of the State. Fields in a Widget subclass are 39 | // always marked "final". 40 | 41 | final String title; 42 | 43 | @override 44 | State createState() => _MyHomePageState(); 45 | } 46 | 47 | class _MyHomePageState extends State { 48 | int _counter = 0; 49 | 50 | void _incrementCounter() { 51 | setState(() { 52 | // This call to setState tells the Flutter framework that something has 53 | // changed in this State, which causes it to rerun the build method below 54 | // so that the display can reflect the updated values. If we changed 55 | // _counter without calling setState(), then the build method would not be 56 | // called again, and so nothing would appear to happen. 57 | _counter++; 58 | }); 59 | } 60 | 61 | @override 62 | Widget build(BuildContext context) { 63 | // This method is rerun every time setState is called, for instance as done 64 | // by the _incrementCounter method above. 65 | // 66 | // The Flutter framework has been optimized to make rerunning build methods 67 | // fast, so that you can just rebuild anything that needs updating rather 68 | // than having to individually change instances of widgets. 69 | return Scaffold( 70 | appBar: AppBar( 71 | // Here we take the value from the MyHomePage object that was created by 72 | // the App.build method, and use it to set our appbar title. 73 | title: Text(widget.title), 74 | ), 75 | body: Center( 76 | // Center is a layout widget. It takes a single child and positions it 77 | // in the middle of the parent. 78 | child: Column( 79 | // Column is also a layout widget. It takes a list of children and 80 | // arranges them vertically. By default, it sizes itself to fit its 81 | // children horizontally, and tries to be as tall as its parent. 82 | // 83 | // Invoke "debug painting" (press "p" in the console, choose the 84 | // "Toggle Debug Paint" action from the Flutter Inspector in Android 85 | // Studio, or the "Toggle Debug Paint" command in Visual Studio Code) 86 | // to see the wireframe for each widget. 87 | // 88 | // Column has various properties to control how it sizes itself and 89 | // how it positions its children. Here we use mainAxisAlignment to 90 | // center the children vertically; the main axis here is the vertical 91 | // axis because Columns are vertical (the cross axis would be 92 | // horizontal). 93 | mainAxisAlignment: MainAxisAlignment.center, 94 | children: [ 95 | const Text( 96 | 'You have pushed the button this many times:', 97 | ), 98 | Text( 99 | '$_counter', 100 | style: Theme.of(context).textTheme.headline4, 101 | ), 102 | ], 103 | ), 104 | ), 105 | floatingActionButton: FloatingActionButton( 106 | onPressed: _incrementCounter, 107 | tooltip: 'Increment', 108 | child: const Icon(Icons.add), 109 | ), // This trailing comma makes auto-formatting nicer for build methods. 110 | ); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /example/flutter_module/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.8.2" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "2.1.0" 18 | characters: 19 | dependency: transitive 20 | description: 21 | name: characters 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.2.0" 25 | charcode: 26 | dependency: transitive 27 | description: 28 | name: charcode 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.3.1" 32 | clock: 33 | dependency: transitive 34 | description: 35 | name: clock 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.0" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.16.0" 46 | cupertino_icons: 47 | dependency: "direct main" 48 | description: 49 | name: cupertino_icons 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.0.4" 53 | fake_async: 54 | dependency: transitive 55 | description: 56 | name: fake_async 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.3.0" 60 | flutter: 61 | dependency: "direct main" 62 | description: flutter 63 | source: sdk 64 | version: "0.0.0" 65 | flutter_lints: 66 | dependency: "direct dev" 67 | description: 68 | name: flutter_lints 69 | url: "https://pub.dartlang.org" 70 | source: hosted 71 | version: "1.0.4" 72 | flutter_test: 73 | dependency: "direct dev" 74 | description: flutter 75 | source: sdk 76 | version: "0.0.0" 77 | lints: 78 | dependency: transitive 79 | description: 80 | name: lints 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "1.0.1" 84 | matcher: 85 | dependency: transitive 86 | description: 87 | name: matcher 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "0.12.11" 91 | material_color_utilities: 92 | dependency: transitive 93 | description: 94 | name: material_color_utilities 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "0.1.4" 98 | meta: 99 | dependency: transitive 100 | description: 101 | name: meta 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "1.7.0" 105 | path: 106 | dependency: transitive 107 | description: 108 | name: path 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "1.8.1" 112 | sky_engine: 113 | dependency: transitive 114 | description: flutter 115 | source: sdk 116 | version: "0.0.99" 117 | source_span: 118 | dependency: transitive 119 | description: 120 | name: source_span 121 | url: "https://pub.dartlang.org" 122 | source: hosted 123 | version: "1.8.2" 124 | stack_trace: 125 | dependency: transitive 126 | description: 127 | name: stack_trace 128 | url: "https://pub.dartlang.org" 129 | source: hosted 130 | version: "1.10.0" 131 | stream_channel: 132 | dependency: transitive 133 | description: 134 | name: stream_channel 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "2.1.0" 138 | string_scanner: 139 | dependency: transitive 140 | description: 141 | name: string_scanner 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "1.1.0" 145 | term_glyph: 146 | dependency: transitive 147 | description: 148 | name: term_glyph 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "1.2.0" 152 | test_api: 153 | dependency: transitive 154 | description: 155 | name: test_api 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "0.4.9" 159 | vector_math: 160 | dependency: transitive 161 | description: 162 | name: vector_math 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "2.1.2" 166 | sdks: 167 | dart: ">=2.17.0-0 <3.0.0" 168 | -------------------------------------------------------------------------------- /example/flutter_module/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_module 2 | description: A new flutter module project. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # In Android, build-name is used as versionName while build-number used as versionCode. 10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 12 | # Read more about iOS versioning at 13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 14 | # 15 | # This version is used _only_ for the Runner app, which is used if you just do 16 | # a `flutter run` or a `flutter make-host-app-editable`. It has no impact 17 | # on any other native host app that you embed your Flutter project into. 18 | version: 1.0.0+1 19 | 20 | environment: 21 | sdk: ">=2.16.1 <3.0.0" 22 | 23 | dependencies: 24 | flutter: 25 | sdk: flutter 26 | 27 | # The following adds the Cupertino Icons font to your application. 28 | # Use with the CupertinoIcons class for iOS style icons. 29 | cupertino_icons: ^1.0.2 30 | 31 | dev_dependencies: 32 | flutter_test: 33 | sdk: flutter 34 | flutter_lints: ^1.0.0 35 | 36 | # For information on the generic Dart part of this file, see the 37 | # following page: https://dart.dev/tools/pub/pubspec 38 | 39 | flutter: 40 | # The following line ensures that the Material Icons font is 41 | # included with your application, so that you can use the icons in 42 | # the material Icons class. 43 | uses-material-design: true 44 | 45 | # To add Flutter specific assets to your application, add an assets section, 46 | # like this: 47 | # assets: 48 | # - images/a_dot_burr.jpeg 49 | # - images/a_dot_ham.jpeg 50 | 51 | # An image asset can refer to one or more resolution-specific "variants", see 52 | # https://flutter.dev/assets-and-images/#resolution-aware. 53 | 54 | # For details regarding adding assets from package dependencies, see 55 | # https://flutter.dev/assets-and-images/#from-packages 56 | 57 | # To add Flutter specific custom fonts to your application, add a fonts 58 | # section here, in this "flutter" section. Each entry in this list should 59 | # have a "family" key with the font family name, and a "fonts" key with a 60 | # list giving the asset and other descriptors for the font. For 61 | # example: 62 | # fonts: 63 | # - family: Schyler 64 | # fonts: 65 | # - asset: fonts/Schyler-Regular.ttf 66 | # - asset: fonts/Schyler-Italic.ttf 67 | # style: italic 68 | # - family: Trajan Pro 69 | # fonts: 70 | # - asset: fonts/TrajanPro.ttf 71 | # - asset: fonts/TrajanPro_Bold.ttf 72 | # weight: 700 73 | # 74 | # For details regarding fonts from package dependencies, 75 | # see https://flutter.dev/custom-fonts/#from-packages 76 | 77 | 78 | # This section identifies your Flutter project as a module meant for 79 | # embedding in a native host app. These identifiers should _not_ ordinarily 80 | # be changed after generation - they are used to ensure that the tooling can 81 | # maintain consistency when adding or modifying assets and plugins. 82 | # They also do not have any bearing on your native host application's 83 | # identifiers, which may be completely independent or the same as these. 84 | module: 85 | androidX: true 86 | androidPackage: com.example.flutter_module 87 | iosBundleIdentifier: com.example.flutterModule 88 | -------------------------------------------------------------------------------- /example/flutter_module/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:flutter_module/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /example/ios_app/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'cocoapods' 4 | gem 'cocoapods-embed-flutter', :path => '../../' 5 | -------------------------------------------------------------------------------- /example/ios_app/Gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: ../.. 3 | specs: 4 | cocoapods-embed-flutter (0.6.1) 5 | cocoapods 6 | concurrent-ruby 7 | fileutils 8 | yaml 9 | 10 | GEM 11 | remote: https://rubygems.org/ 12 | specs: 13 | CFPropertyList (3.0.5) 14 | rexml 15 | activesupport (6.1.7.3) 16 | concurrent-ruby (~> 1.0, >= 1.0.2) 17 | i18n (>= 1.6, < 2) 18 | minitest (>= 5.1) 19 | tzinfo (~> 2.0) 20 | zeitwerk (~> 2.3) 21 | addressable (2.8.0) 22 | public_suffix (>= 2.0.2, < 5.0) 23 | algoliasearch (1.27.5) 24 | httpclient (~> 2.8, >= 2.8.3) 25 | json (>= 1.5.1) 26 | atomos (0.1.3) 27 | claide (1.1.0) 28 | cocoapods (1.11.3) 29 | addressable (~> 2.8) 30 | claide (>= 1.0.2, < 2.0) 31 | cocoapods-core (= 1.11.3) 32 | cocoapods-deintegrate (>= 1.0.3, < 2.0) 33 | cocoapods-downloader (>= 1.4.0, < 2.0) 34 | cocoapods-plugins (>= 1.0.0, < 2.0) 35 | cocoapods-search (>= 1.0.0, < 2.0) 36 | cocoapods-trunk (>= 1.4.0, < 2.0) 37 | cocoapods-try (>= 1.1.0, < 2.0) 38 | colored2 (~> 3.1) 39 | escape (~> 0.0.4) 40 | fourflusher (>= 2.3.0, < 3.0) 41 | gh_inspector (~> 1.0) 42 | molinillo (~> 0.8.0) 43 | nap (~> 1.0) 44 | ruby-macho (>= 1.0, < 3.0) 45 | xcodeproj (>= 1.21.0, < 2.0) 46 | cocoapods-core (1.11.3) 47 | activesupport (>= 5.0, < 7) 48 | addressable (~> 2.8) 49 | algoliasearch (~> 1.0) 50 | concurrent-ruby (~> 1.1) 51 | fuzzy_match (~> 2.0.4) 52 | nap (~> 1.0) 53 | netrc (~> 0.11) 54 | public_suffix (~> 4.0) 55 | typhoeus (~> 1.0) 56 | cocoapods-deintegrate (1.0.5) 57 | cocoapods-downloader (1.6.3) 58 | cocoapods-plugins (1.0.0) 59 | nap 60 | cocoapods-search (1.0.1) 61 | cocoapods-trunk (1.6.0) 62 | nap (>= 0.8, < 2.0) 63 | netrc (~> 0.11) 64 | cocoapods-try (1.2.0) 65 | colored2 (3.1.2) 66 | concurrent-ruby (1.2.2) 67 | escape (0.0.4) 68 | ethon (0.15.0) 69 | ffi (>= 1.15.0) 70 | ffi (1.15.5) 71 | fileutils (1.6.0) 72 | fourflusher (2.3.1) 73 | fuzzy_match (2.0.4) 74 | gh_inspector (1.1.3) 75 | httpclient (2.8.3) 76 | i18n (1.12.0) 77 | concurrent-ruby (~> 1.0) 78 | json (2.6.1) 79 | minitest (5.18.0) 80 | molinillo (0.8.0) 81 | nanaimo (0.3.0) 82 | nap (1.1.0) 83 | netrc (0.11.0) 84 | public_suffix (4.0.6) 85 | rexml (3.2.5) 86 | ruby-macho (2.5.1) 87 | typhoeus (1.4.0) 88 | ethon (>= 0.9.0) 89 | tzinfo (2.0.6) 90 | concurrent-ruby (~> 1.0) 91 | xcodeproj (1.21.0) 92 | CFPropertyList (>= 2.3.3, < 4.0) 93 | atomos (~> 0.1.3) 94 | claide (>= 1.0.2, < 2.0) 95 | colored2 (~> 3.1) 96 | nanaimo (~> 0.3.0) 97 | rexml (~> 3.2.4) 98 | yaml (0.2.0) 99 | zeitwerk (2.6.7) 100 | 101 | PLATFORMS 102 | universal-darwin-21 103 | x86_64-darwin-19 104 | x86_64-linux 105 | 106 | DEPENDENCIES 107 | cocoapods 108 | cocoapods-embed-flutter! 109 | 110 | BUNDLED WITH 111 | 2.3.7 112 | -------------------------------------------------------------------------------- /example/ios_app/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | platform :ios, '9.0' 3 | plugin 'cocoapods-embed-flutter' 4 | 5 | target 'ios_app' do 6 | # Comment the next line if you don't want to use dynamic frameworks 7 | use_frameworks! 8 | 9 | # Pods for ios_app 10 | pub 'flutter_module', :path => '../' 11 | end 12 | -------------------------------------------------------------------------------- /example/ios_app/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - flutter_module (0.0.1): 4 | - Flutter 5 | - FlutterPluginRegistrant (0.0.1): 6 | - Flutter 7 | 8 | DEPENDENCIES: 9 | - Flutter (from `../flutter_module/.ios/Flutter/engine`) 10 | - flutter_module (from `../flutter_module/.ios/Flutter`) 11 | - FlutterPluginRegistrant (from `../flutter_module/.ios/Flutter/FlutterPluginRegistrant`) 12 | 13 | EXTERNAL SOURCES: 14 | Flutter: 15 | :path: "../flutter_module/.ios/Flutter/engine" 16 | flutter_module: 17 | :path: "../flutter_module/.ios/Flutter" 18 | FlutterPluginRegistrant: 19 | :path: "../flutter_module/.ios/Flutter/FlutterPluginRegistrant" 20 | 21 | SPEC CHECKSUMS: 22 | Flutter: bdfa2e8fe0e2880a2c6a58a0b1a8675c262a07af 23 | flutter_module: d1e1ff44505640bd9aa37f23f63380c646272be4 24 | FlutterPluginRegistrant: d3a0fbc12bc47787a12fcc919193f3959aa7d5ad 25 | 26 | PODFILE CHECKSUM: 63b6421f4bf00554065d89d2308ed2deb78332fc 27 | 28 | COCOAPODS: 1.11.3 29 | -------------------------------------------------------------------------------- /example/ios_app/ios_app.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 55; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 22CB562DAD2D1C676D5358E3 /* Pods_ios_app.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79B5C9758BB57E0B419A9552 /* Pods_ios_app.framework */; }; 11 | 2471880027D496AC00059CE2 /* ios_appApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 247187FF27D496AC00059CE2 /* ios_appApp.swift */; }; 12 | 2471880227D496AC00059CE2 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2471880127D496AC00059CE2 /* ContentView.swift */; }; 13 | 2471880427D496AD00059CE2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2471880327D496AD00059CE2 /* Assets.xcassets */; }; 14 | 2471880727D496AD00059CE2 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2471880627D496AD00059CE2 /* Preview Assets.xcassets */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXFileReference section */ 18 | 247187FC27D496AC00059CE2 /* ios_app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ios_app.app; sourceTree = BUILT_PRODUCTS_DIR; }; 19 | 247187FF27D496AC00059CE2 /* ios_appApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ios_appApp.swift; sourceTree = ""; }; 20 | 2471880127D496AC00059CE2 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 21 | 2471880327D496AD00059CE2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 22 | 2471880627D496AD00059CE2 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 23 | 50ED8077F22A1CBA4F02FFCF /* Pods-ios_app.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ios_app.debug.xcconfig"; path = "Target Support Files/Pods-ios_app/Pods-ios_app.debug.xcconfig"; sourceTree = ""; }; 24 | 79B5C9758BB57E0B419A9552 /* Pods_ios_app.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ios_app.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | 98E2D0C2FE73392EB0FDA00B /* Pods-ios_app.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ios_app.release.xcconfig"; path = "Target Support Files/Pods-ios_app/Pods-ios_app.release.xcconfig"; sourceTree = ""; }; 26 | /* End PBXFileReference section */ 27 | 28 | /* Begin PBXFrameworksBuildPhase section */ 29 | 247187F927D496AC00059CE2 /* Frameworks */ = { 30 | isa = PBXFrameworksBuildPhase; 31 | buildActionMask = 2147483647; 32 | files = ( 33 | 22CB562DAD2D1C676D5358E3 /* Pods_ios_app.framework in Frameworks */, 34 | ); 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXFrameworksBuildPhase section */ 38 | 39 | /* Begin PBXGroup section */ 40 | 247187F327D496AC00059CE2 = { 41 | isa = PBXGroup; 42 | children = ( 43 | 247187FE27D496AC00059CE2 /* ios_app */, 44 | 247187FD27D496AC00059CE2 /* Products */, 45 | 50216A5544007A9BD9A16E0C /* Pods */, 46 | F73D541B21D74A80060D155B /* Frameworks */, 47 | ); 48 | sourceTree = ""; 49 | }; 50 | 247187FD27D496AC00059CE2 /* Products */ = { 51 | isa = PBXGroup; 52 | children = ( 53 | 247187FC27D496AC00059CE2 /* ios_app.app */, 54 | ); 55 | name = Products; 56 | sourceTree = ""; 57 | }; 58 | 247187FE27D496AC00059CE2 /* ios_app */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 247187FF27D496AC00059CE2 /* ios_appApp.swift */, 62 | 2471880127D496AC00059CE2 /* ContentView.swift */, 63 | 2471880327D496AD00059CE2 /* Assets.xcassets */, 64 | 2471880527D496AD00059CE2 /* Preview Content */, 65 | ); 66 | path = ios_app; 67 | sourceTree = ""; 68 | }; 69 | 2471880527D496AD00059CE2 /* Preview Content */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | 2471880627D496AD00059CE2 /* Preview Assets.xcassets */, 73 | ); 74 | path = "Preview Content"; 75 | sourceTree = ""; 76 | }; 77 | 50216A5544007A9BD9A16E0C /* Pods */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 50ED8077F22A1CBA4F02FFCF /* Pods-ios_app.debug.xcconfig */, 81 | 98E2D0C2FE73392EB0FDA00B /* Pods-ios_app.release.xcconfig */, 82 | ); 83 | name = Pods; 84 | path = Pods; 85 | sourceTree = ""; 86 | }; 87 | F73D541B21D74A80060D155B /* Frameworks */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | 79B5C9758BB57E0B419A9552 /* Pods_ios_app.framework */, 91 | ); 92 | name = Frameworks; 93 | sourceTree = ""; 94 | }; 95 | /* End PBXGroup section */ 96 | 97 | /* Begin PBXNativeTarget section */ 98 | 247187FB27D496AC00059CE2 /* ios_app */ = { 99 | isa = PBXNativeTarget; 100 | buildConfigurationList = 2471880A27D496AD00059CE2 /* Build configuration list for PBXNativeTarget "ios_app" */; 101 | buildPhases = ( 102 | 35BF99F470B5D4D6E728DB41 /* [CP] Check Pods Manifest.lock */, 103 | 53FA3069BD2E4806E9D8564B /* [CP-User] Run Flutter Build flutter_module Script */, 104 | 247187F827D496AC00059CE2 /* Sources */, 105 | 247187F927D496AC00059CE2 /* Frameworks */, 106 | 247187FA27D496AC00059CE2 /* Resources */, 107 | 3D8B7144B0E208F0862E51E5 /* [CP] Embed Pods Frameworks */, 108 | ); 109 | buildRules = ( 110 | ); 111 | dependencies = ( 112 | ); 113 | name = ios_app; 114 | productName = ios_app; 115 | productReference = 247187FC27D496AC00059CE2 /* ios_app.app */; 116 | productType = "com.apple.product-type.application"; 117 | }; 118 | /* End PBXNativeTarget section */ 119 | 120 | /* Begin PBXProject section */ 121 | 247187F427D496AC00059CE2 /* Project object */ = { 122 | isa = PBXProject; 123 | attributes = { 124 | BuildIndependentTargetsInParallel = 1; 125 | LastSwiftUpdateCheck = 1320; 126 | LastUpgradeCheck = 1320; 127 | TargetAttributes = { 128 | 247187FB27D496AC00059CE2 = { 129 | CreatedOnToolsVersion = 13.2.1; 130 | }; 131 | }; 132 | }; 133 | buildConfigurationList = 247187F727D496AC00059CE2 /* Build configuration list for PBXProject "ios_app" */; 134 | compatibilityVersion = "Xcode 13.0"; 135 | developmentRegion = en; 136 | hasScannedForEncodings = 0; 137 | knownRegions = ( 138 | en, 139 | Base, 140 | ); 141 | mainGroup = 247187F327D496AC00059CE2; 142 | productRefGroup = 247187FD27D496AC00059CE2 /* Products */; 143 | projectDirPath = ""; 144 | projectRoot = ""; 145 | targets = ( 146 | 247187FB27D496AC00059CE2 /* ios_app */, 147 | ); 148 | }; 149 | /* End PBXProject section */ 150 | 151 | /* Begin PBXResourcesBuildPhase section */ 152 | 247187FA27D496AC00059CE2 /* Resources */ = { 153 | isa = PBXResourcesBuildPhase; 154 | buildActionMask = 2147483647; 155 | files = ( 156 | 2471880727D496AD00059CE2 /* Preview Assets.xcassets in Resources */, 157 | 2471880427D496AD00059CE2 /* Assets.xcassets in Resources */, 158 | ); 159 | runOnlyForDeploymentPostprocessing = 0; 160 | }; 161 | /* End PBXResourcesBuildPhase section */ 162 | 163 | /* Begin PBXShellScriptBuildPhase section */ 164 | 35BF99F470B5D4D6E728DB41 /* [CP] Check Pods Manifest.lock */ = { 165 | isa = PBXShellScriptBuildPhase; 166 | buildActionMask = 2147483647; 167 | files = ( 168 | ); 169 | inputFileListPaths = ( 170 | ); 171 | inputPaths = ( 172 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 173 | "${PODS_ROOT}/Manifest.lock", 174 | ); 175 | name = "[CP] Check Pods Manifest.lock"; 176 | outputFileListPaths = ( 177 | ); 178 | outputPaths = ( 179 | "$(DERIVED_FILE_DIR)/Pods-ios_app-checkManifestLockResult.txt", 180 | ); 181 | runOnlyForDeploymentPostprocessing = 0; 182 | shellPath = /bin/sh; 183 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 184 | showEnvVarsInLog = 0; 185 | }; 186 | 3D8B7144B0E208F0862E51E5 /* [CP] Embed Pods Frameworks */ = { 187 | isa = PBXShellScriptBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | ); 191 | inputFileListPaths = ( 192 | "${PODS_ROOT}/Target Support Files/Pods-ios_app/Pods-ios_app-frameworks-${CONFIGURATION}-input-files.xcfilelist", 193 | ); 194 | name = "[CP] Embed Pods Frameworks"; 195 | outputFileListPaths = ( 196 | "${PODS_ROOT}/Target Support Files/Pods-ios_app/Pods-ios_app-frameworks-${CONFIGURATION}-output-files.xcfilelist", 197 | ); 198 | runOnlyForDeploymentPostprocessing = 0; 199 | shellPath = /bin/sh; 200 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ios_app/Pods-ios_app-frameworks.sh\"\n"; 201 | showEnvVarsInLog = 0; 202 | }; 203 | 53FA3069BD2E4806E9D8564B /* [CP-User] Run Flutter Build flutter_module Script */ = { 204 | isa = PBXShellScriptBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | ); 208 | name = "[CP-User] Run Flutter Build flutter_module Script"; 209 | runOnlyForDeploymentPostprocessing = 0; 210 | shellPath = /bin/sh; 211 | shellScript = "set -e\nset -u\nsource \"${SRCROOT}/../flutter_module/.ios/Flutter/flutter_export_environment.sh\"\nexport VERBOSE_SCRIPT_LOGGING=1 && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/xcode_backend.sh build"; 212 | }; 213 | /* End PBXShellScriptBuildPhase section */ 214 | 215 | /* Begin PBXSourcesBuildPhase section */ 216 | 247187F827D496AC00059CE2 /* Sources */ = { 217 | isa = PBXSourcesBuildPhase; 218 | buildActionMask = 2147483647; 219 | files = ( 220 | 2471880227D496AC00059CE2 /* ContentView.swift in Sources */, 221 | 2471880027D496AC00059CE2 /* ios_appApp.swift in Sources */, 222 | ); 223 | runOnlyForDeploymentPostprocessing = 0; 224 | }; 225 | /* End PBXSourcesBuildPhase section */ 226 | 227 | /* Begin XCBuildConfiguration section */ 228 | 2471880827D496AD00059CE2 /* Debug */ = { 229 | isa = XCBuildConfiguration; 230 | buildSettings = { 231 | ALWAYS_SEARCH_USER_PATHS = NO; 232 | CLANG_ANALYZER_NONNULL = YES; 233 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 234 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 235 | CLANG_CXX_LIBRARY = "libc++"; 236 | CLANG_ENABLE_MODULES = YES; 237 | CLANG_ENABLE_OBJC_ARC = YES; 238 | CLANG_ENABLE_OBJC_WEAK = YES; 239 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 240 | CLANG_WARN_BOOL_CONVERSION = YES; 241 | CLANG_WARN_COMMA = YES; 242 | CLANG_WARN_CONSTANT_CONVERSION = YES; 243 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 244 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 245 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 246 | CLANG_WARN_EMPTY_BODY = YES; 247 | CLANG_WARN_ENUM_CONVERSION = YES; 248 | CLANG_WARN_INFINITE_RECURSION = YES; 249 | CLANG_WARN_INT_CONVERSION = YES; 250 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 251 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 252 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 253 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 254 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 255 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 256 | CLANG_WARN_STRICT_PROTOTYPES = YES; 257 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 258 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 259 | CLANG_WARN_UNREACHABLE_CODE = YES; 260 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 261 | COPY_PHASE_STRIP = NO; 262 | DEBUG_INFORMATION_FORMAT = dwarf; 263 | ENABLE_STRICT_OBJC_MSGSEND = YES; 264 | ENABLE_TESTABILITY = YES; 265 | GCC_C_LANGUAGE_STANDARD = gnu11; 266 | GCC_DYNAMIC_NO_PIC = NO; 267 | GCC_NO_COMMON_BLOCKS = YES; 268 | GCC_OPTIMIZATION_LEVEL = 0; 269 | GCC_PREPROCESSOR_DEFINITIONS = ( 270 | "DEBUG=1", 271 | "$(inherited)", 272 | ); 273 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 274 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 275 | GCC_WARN_UNDECLARED_SELECTOR = YES; 276 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 277 | GCC_WARN_UNUSED_FUNCTION = YES; 278 | GCC_WARN_UNUSED_VARIABLE = YES; 279 | IPHONEOS_DEPLOYMENT_TARGET = 15.2; 280 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 281 | MTL_FAST_MATH = YES; 282 | ONLY_ACTIVE_ARCH = YES; 283 | SDKROOT = iphoneos; 284 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 285 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 286 | }; 287 | name = Debug; 288 | }; 289 | 2471880927D496AD00059CE2 /* Release */ = { 290 | isa = XCBuildConfiguration; 291 | buildSettings = { 292 | ALWAYS_SEARCH_USER_PATHS = NO; 293 | CLANG_ANALYZER_NONNULL = YES; 294 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 295 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 296 | CLANG_CXX_LIBRARY = "libc++"; 297 | CLANG_ENABLE_MODULES = YES; 298 | CLANG_ENABLE_OBJC_ARC = YES; 299 | CLANG_ENABLE_OBJC_WEAK = YES; 300 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 301 | CLANG_WARN_BOOL_CONVERSION = YES; 302 | CLANG_WARN_COMMA = YES; 303 | CLANG_WARN_CONSTANT_CONVERSION = YES; 304 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 305 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 306 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 307 | CLANG_WARN_EMPTY_BODY = YES; 308 | CLANG_WARN_ENUM_CONVERSION = YES; 309 | CLANG_WARN_INFINITE_RECURSION = YES; 310 | CLANG_WARN_INT_CONVERSION = YES; 311 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 312 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 313 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 314 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 315 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 316 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 317 | CLANG_WARN_STRICT_PROTOTYPES = YES; 318 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 319 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 320 | CLANG_WARN_UNREACHABLE_CODE = YES; 321 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 322 | COPY_PHASE_STRIP = NO; 323 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 324 | ENABLE_NS_ASSERTIONS = NO; 325 | ENABLE_STRICT_OBJC_MSGSEND = YES; 326 | GCC_C_LANGUAGE_STANDARD = gnu11; 327 | GCC_NO_COMMON_BLOCKS = YES; 328 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 329 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 330 | GCC_WARN_UNDECLARED_SELECTOR = YES; 331 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 332 | GCC_WARN_UNUSED_FUNCTION = YES; 333 | GCC_WARN_UNUSED_VARIABLE = YES; 334 | IPHONEOS_DEPLOYMENT_TARGET = 15.2; 335 | MTL_ENABLE_DEBUG_INFO = NO; 336 | MTL_FAST_MATH = YES; 337 | SDKROOT = iphoneos; 338 | SWIFT_COMPILATION_MODE = wholemodule; 339 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 340 | VALIDATE_PRODUCT = YES; 341 | }; 342 | name = Release; 343 | }; 344 | 2471880B27D496AD00059CE2 /* Debug */ = { 345 | isa = XCBuildConfiguration; 346 | baseConfigurationReference = 50ED8077F22A1CBA4F02FFCF /* Pods-ios_app.debug.xcconfig */; 347 | buildSettings = { 348 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 349 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 350 | CODE_SIGN_STYLE = Automatic; 351 | CURRENT_PROJECT_VERSION = 1; 352 | DEVELOPMENT_ASSET_PATHS = "\"ios_app/Preview Content\""; 353 | ENABLE_PREVIEWS = YES; 354 | GENERATE_INFOPLIST_FILE = YES; 355 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 356 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 357 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 358 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 359 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 360 | LD_RUNPATH_SEARCH_PATHS = ( 361 | "$(inherited)", 362 | "@executable_path/Frameworks", 363 | ); 364 | MARKETING_VERSION = 1.0; 365 | PRODUCT_BUNDLE_IDENTIFIER = "com.soumyamahunt.ios-app"; 366 | PRODUCT_NAME = "$(TARGET_NAME)"; 367 | SWIFT_EMIT_LOC_STRINGS = YES; 368 | SWIFT_VERSION = 5.0; 369 | TARGETED_DEVICE_FAMILY = "1,2"; 370 | }; 371 | name = Debug; 372 | }; 373 | 2471880C27D496AD00059CE2 /* Release */ = { 374 | isa = XCBuildConfiguration; 375 | baseConfigurationReference = 98E2D0C2FE73392EB0FDA00B /* Pods-ios_app.release.xcconfig */; 376 | buildSettings = { 377 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 378 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 379 | CODE_SIGN_STYLE = Automatic; 380 | CURRENT_PROJECT_VERSION = 1; 381 | DEVELOPMENT_ASSET_PATHS = "\"ios_app/Preview Content\""; 382 | ENABLE_PREVIEWS = YES; 383 | GENERATE_INFOPLIST_FILE = YES; 384 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 385 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 386 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 387 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 388 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 389 | LD_RUNPATH_SEARCH_PATHS = ( 390 | "$(inherited)", 391 | "@executable_path/Frameworks", 392 | ); 393 | MARKETING_VERSION = 1.0; 394 | PRODUCT_BUNDLE_IDENTIFIER = "com.soumyamahunt.ios-app"; 395 | PRODUCT_NAME = "$(TARGET_NAME)"; 396 | SWIFT_EMIT_LOC_STRINGS = YES; 397 | SWIFT_VERSION = 5.0; 398 | TARGETED_DEVICE_FAMILY = "1,2"; 399 | }; 400 | name = Release; 401 | }; 402 | /* End XCBuildConfiguration section */ 403 | 404 | /* Begin XCConfigurationList section */ 405 | 247187F727D496AC00059CE2 /* Build configuration list for PBXProject "ios_app" */ = { 406 | isa = XCConfigurationList; 407 | buildConfigurations = ( 408 | 2471880827D496AD00059CE2 /* Debug */, 409 | 2471880927D496AD00059CE2 /* Release */, 410 | ); 411 | defaultConfigurationIsVisible = 0; 412 | defaultConfigurationName = Release; 413 | }; 414 | 2471880A27D496AD00059CE2 /* Build configuration list for PBXNativeTarget "ios_app" */ = { 415 | isa = XCConfigurationList; 416 | buildConfigurations = ( 417 | 2471880B27D496AD00059CE2 /* Debug */, 418 | 2471880C27D496AD00059CE2 /* Release */, 419 | ); 420 | defaultConfigurationIsVisible = 0; 421 | defaultConfigurationName = Release; 422 | }; 423 | /* End XCConfigurationList section */ 424 | }; 425 | rootObject = 247187F427D496AC00059CE2 /* Project object */; 426 | } 427 | -------------------------------------------------------------------------------- /example/ios_app/ios_app/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /example/ios_app/ios_app/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /example/ios_app/ios_app/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios_app/ios_app/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // ios_app 4 | // 5 | // Created by Soumya Ranjan Mahunt on 06/03/22. 6 | // 7 | 8 | import SwiftUI 9 | import Flutter 10 | import FlutterPluginRegistrant 11 | 12 | struct ContentView: View { 13 | var body: some View { 14 | NavigationView { 15 | VStack { 16 | Text("Hello, world!") 17 | .padding() 18 | NavigationLink("Go to Flutter", destination: FlutterView()) 19 | } 20 | } 21 | } 22 | } 23 | 24 | 25 | struct FlutterView: UIViewControllerRepresentable { 26 | 27 | func makeUIViewController(context: Context) -> FlutterViewController { 28 | let flutterViewController = FlutterViewController(project: nil, nibName: nil, bundle: nil) 29 | return flutterViewController 30 | } 31 | 32 | func updateUIViewController(_ uiViewController: FlutterViewController, context: Context) { 33 | } 34 | } 35 | 36 | struct ContentView_Previews: PreviewProvider { 37 | static var previews: some View { 38 | ContentView() 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /example/ios_app/ios_app/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios_app/ios_app/ios_appApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ios_appApp.swift 3 | // ios_app 4 | // 5 | // Created by Soumya Ranjan Mahunt on 06/03/22. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct ios_appApp: App { 12 | 13 | var body: some Scene { 14 | WindowGroup { 15 | ContentView() 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/cocoapods-embed-flutter.rb: -------------------------------------------------------------------------------- 1 | require 'cocoapods-embed-flutter/gem_version' 2 | require 'cocoapods-embed-flutter/source' 3 | require 'cocoapods-embed-flutter/hooks' 4 | require 'cocoapods-embed-flutter/flutter' 5 | -------------------------------------------------------------------------------- /lib/cocoapods-embed-flutter/flutter.rb: -------------------------------------------------------------------------------- 1 | # The Flutter modules name-spaces all the classes for Flutter. 2 | # 3 | module Flutter 4 | # The flutter command name. 5 | # 6 | NAME = 'flutter'.freeze 7 | # The directory name for flutter specific 8 | # files in a flutter project. 9 | # 10 | DIR_NAME = 'Flutter'.freeze 11 | # The Pub modules name-spaces all the classes for Flutter Pub. 12 | # 13 | module Pub 14 | # The file name for flutter specification declaration. 15 | # 16 | SPEC_FILE = 'pubspec.yaml'.freeze 17 | # The folder name containing flutter dependencies cache files. 18 | # 19 | TOOL_DIR = '.dart_tool'.freeze 20 | # The cache file name for flutter projects. 21 | # 22 | CACHE_FILE = 'package_config.json'.freeze 23 | 24 | require 'cocoapods-embed-flutter/flutter/downloader' 25 | require 'cocoapods-embed-flutter/flutter/external_sources' 26 | 27 | autoload :Dependency, 'cocoapods-embed-flutter/flutter/dependency' 28 | autoload :Spec, 'cocoapods-embed-flutter/flutter/pubspec' 29 | end 30 | end -------------------------------------------------------------------------------- /lib/cocoapods-embed-flutter/flutter/dependency.rb: -------------------------------------------------------------------------------- 1 | require 'cocoapods-embed-flutter/flutter' 2 | 3 | module Flutter 4 | module Pub 5 | # Provides a DSL to describe a flutter dependency. A dependency is defined in 6 | # `pubspec.yaml` in `dependencies` or `dev_dependencies` sections. 7 | # 8 | class Dependency 9 | # @return [String] the name of the dependency. 10 | # 11 | attr_reader :name 12 | # @return [String, Hash] the requirements for 13 | # dependency as declred in parent `pubspec`. 14 | # 15 | attr_reader :requirements 16 | # @return [Spec] the parent specification where 17 | # dependency declared. 18 | # 19 | attr_reader :parent_spec 20 | # @return [Boolean] If this specification is an app specification. 21 | # 22 | attr_reader :is_dev_dependency 23 | 24 | # @param [String] name 25 | # the name of the specification. 26 | # 27 | # @param [String, Hash] requirements 28 | # the requirements for dependency as declred in `pubspec` 29 | # 30 | # @param [Spec] parent_spec 31 | # the parent specification where dependency declared 32 | # 33 | # @param [Boolean] dev_dependency 34 | # Whether the dependency only required during development 35 | # 36 | def initialize(name, requirements, parent_spec, dev_dependency = false) 37 | raise StandardError, 'A flutter dependency requires a name.' unless name 38 | raise StandardError, 'A flutter dependency requires a parent pubspec.' unless parent_spec.is_a?(Flutter::Pub::Spec) 39 | @name = name 40 | @requirements = requirements 41 | @parent_spec = parent_spec 42 | @is_dev_dependency = dev_dependency 43 | end 44 | 45 | # Returns dependencies from hash declared in `dependencies` or `dev_dependencies` 46 | # section in `pubspec.yaml` file. 47 | # 48 | # @param [Hash] hash declared in `dependencies` or `dev_dependencies` 49 | # section in `pubspec.yaml` file 50 | # 51 | # @param [Spec] parent_spec 52 | # the parent specification where dependency declared 53 | # 54 | # @param [Boolean] dev_dependency 55 | # Whether the dependency only required during development 56 | # 57 | # @return [Array] dependencies from hash declared in `dependencies` 58 | # or `dev_dependencies` section in `pubspec.yaml` file. 59 | # 60 | def self.create_from_hash(hash, parent_spec, dev_dependency = false) 61 | raise StandardError, 'A flutter dependency requires a parent pubspec.' unless parent_spec.is_a?(Flutter::Pub::Spec) 62 | hash.keys.map { |key| Dependency.new(key, hash[key], parent_spec, dev_dependency) } 63 | end 64 | 65 | # @return [Boolean] If this dependency is a local flutter project. 66 | # 67 | def local? 68 | requirements.is_a?(Hash) && requirements.include?('path') 69 | end 70 | 71 | # @return [Spec] for this dependency if this dependency is a local flutter project. 72 | # 73 | def spec 74 | Spec.find(name, File.expand_path(path, File.dirname(parent_spec.defined_in_file))) 75 | end 76 | 77 | # Concurrently install this dependency for the parent project. 78 | # 79 | # @return [Concurrent::Promises::Future, Nil] 80 | # {Nil} if not a local dependency, otherwise 81 | # returns future for {#spec}'s {Spec#pub_get pub_get} task. 82 | # 83 | def install 84 | spec.pub_get if local? 85 | end 86 | 87 | # Allows accessing top level values in 88 | # {https://dart.dev/tools/pub/dependencies dependency requirements}, 89 | # if {#requirements} type is {Hash}, i.e. path, git etc. 90 | # 91 | # @param [Symbol] m 92 | # top level key value to access, i.e. path, git etc. 93 | # 94 | # @return depending on accessed value type in {#requirements}. 95 | # 96 | # @raise [NoMethodError] if no method or custom attribute exists by 97 | # the attribute name in {#requirements} or {#requirements} 98 | # is not a {Hash}. 99 | # 100 | def method_missing(m, *args, &block) 101 | if requirements.is_a?(Hash) && requirements.include?(m.to_s) 102 | return requirements[m.to_s] 103 | end 104 | super.method_missing(m, *args, &block) 105 | end 106 | end 107 | end 108 | end -------------------------------------------------------------------------------- /lib/cocoapods-embed-flutter/flutter/downloader.rb: -------------------------------------------------------------------------------- 1 | require 'cocoapods' 2 | require 'fileutils' 3 | 4 | module Flutter 5 | module Pub 6 | # The Downloader modules name-spaces all the classes and methods 7 | # for downloading and caching remote Flutter projects. 8 | # 9 | module Downloader 10 | # Downloads a package from the given `request` to the given `target` location. 11 | # 12 | # @return [Response] The download response for this download. 13 | # 14 | # @param [Request] request 15 | # the request that describes the flutter project download. 16 | # 17 | # @param [Pathname,Nil] target 18 | # the location to which the flutter project should be downloaded. 19 | # 20 | # @param [Boolean] can_cache 21 | # whether caching is allowed. 22 | # 23 | # @param [Pathname,Nil] cache_path 24 | # the path used to cache flutter project downloads. 25 | # 26 | # @todo Implement caching for remote sources. 27 | # 28 | def self.download( 29 | request, 30 | target, 31 | can_cache: true, 32 | cache_path: Pod::Config.instance.cache_root + 'Pods' 33 | ) 34 | can_cache &&= !Pod::Config.instance.skip_download_cache 35 | 36 | request = Pod::Downloader.preprocess_request(request) 37 | 38 | # if can_cache 39 | # raise ArgumentError, 'Must provide a `cache_path` when caching.' unless cache_path 40 | # cache = Pod::Downloader::Cache.new(cache_path) 41 | # result = cache.download_pod(request) 42 | # else 43 | # raise ArgumentError, 'Must provide a `target` when caching is disabled.' unless target 44 | 45 | # result, = Pod::Downloader.download_request(request, target) 46 | # Pod::Installer::PodSourcePreparer.new(result.spec, result.location).prepare! 47 | # end 48 | raise ArgumentError, 'Must provide a `target` when caching is disabled.' unless target 49 | result, = Pod::Downloader.download_request(request, target) 50 | 51 | if target && result.location && target != result.location 52 | Pod::UI.message "Copying #{request.name} from `#{result.location}` to #{UI.path target}", '> ' do 53 | Pod::Downloader::Cache.read_lock(result.location) do 54 | FileUtils.rm_rf target 55 | FileUtils.cp_r(result.location, target) 56 | end 57 | end 58 | end 59 | result 60 | end 61 | end 62 | end 63 | end -------------------------------------------------------------------------------- /lib/cocoapods-embed-flutter/flutter/external_sources.rb: -------------------------------------------------------------------------------- 1 | # Similar to: 2 | # https://github.com/CocoaPods/CocoaPods/blob/master/lib/cocoapods/external_sources/abstract_external_source.rb 3 | require 'cocoapods-embed-flutter/flutter' 4 | require 'cocoapods' 5 | 6 | module Flutter 7 | module Pub 8 | # The ExternalSources modules name-spaces all the classes 9 | # for accessing remote Flutter projects. 10 | # 11 | module ExternalSources 12 | # The keys accepted by the hash of the source attribute. 13 | # 14 | SOURCE_KEYS = { 15 | :git => [:tag, :branch, :commit, :submodules].freeze, 16 | :svn => [:folder, :tag, :revision].freeze, 17 | :hg => [:revision].freeze, 18 | :http => [:flatten, :type, :sha256, :sha1, :headers].freeze, 19 | }.freeze 20 | 21 | # Returns the path to `pubspec` with the given name and location to search. 22 | # 23 | # @param [String] name 24 | # the name of the project declared in `pubspec`. 25 | # 26 | # @param [Hash] options 27 | # requirement opttions for the source of project. 28 | # 29 | # @note the source of project can either be local or all the remotes 30 | # supported by `cocoapods-downloader`. 31 | # 32 | # @return [Spec] the `pubspec` with the given name satisfying 33 | # requirement options. 34 | # 35 | def self.fetchWithNameAndOptions(name, options) 36 | raise StandardError, 'A flutter module requires a name.' unless name 37 | 38 | options = options.last if options.is_a?(Array) 39 | raise StandardError, "No options specified for flutter module: '#{name}'." unless options.is_a?(Hash) 40 | 41 | if SOURCE_KEYS.keys.any? { |key| options.key?(key) } 42 | source = DownloaderSource.new(name, options, Pod::Config.instance.podfile_path) 43 | source.fetch(Pod::Config.instance.sandbox) 44 | path = source.normalized_pubspec_path 45 | elsif options.key?(:path) 46 | path = options[:path] 47 | else 48 | raise StandardError, "Invalid flutter module: '#{name}'." 49 | end 50 | 51 | return Spec.find(name, path) 52 | end 53 | 54 | # Provides support for fetching a specification file from a source handled 55 | # by the downloader. Supports all the options of the downloader 56 | # 57 | # @note The pubspec must be in the root of the repository 58 | # or in directory with the name provided 59 | # 60 | class DownloaderSource 61 | # @return [String] the name of the Package described by this external source. 62 | # 63 | attr_reader :name 64 | 65 | # @return [Hash{Symbol => String}] the hash representation of the 66 | # external source. 67 | # 68 | attr_reader :params 69 | 70 | # @return [String] the path where the podfile is defined to resolve 71 | # relative paths. 72 | # 73 | attr_reader :podfile_path 74 | 75 | # @return [Boolean] Whether the source is allowed to touch the cache. 76 | # 77 | attr_reader :can_cache 78 | alias_method :can_cache?, :can_cache 79 | 80 | # Initialize a new instance 81 | # 82 | # @param [String] name @see #name 83 | # @param [Hash] params @see #params 84 | # @param [String] podfile_path @see #podfile_path 85 | # @param [Boolean] can_cache @see #can_cache 86 | # 87 | def initialize(name, params, podfile_path, can_cache = true) 88 | @name = name 89 | @params = params 90 | @podfile_path = podfile_path 91 | @can_cache = can_cache 92 | end 93 | 94 | # @return [Boolean] whether an external source source is equal to another 95 | # according to the {#name} and to the {#params}. 96 | # 97 | def ==(other) 98 | return false if other.nil? 99 | name == other.name && params == other.params 100 | end 101 | 102 | 103 | public 104 | 105 | # Fetches the external source from the remote according to the params. 106 | # 107 | # @param [Pod::Sandbox] sandbox 108 | # the sandbox where the specification should be stored. 109 | # 110 | # @return [void] 111 | # 112 | def fetch(sandbox) 113 | pre_download(sandbox) 114 | end 115 | 116 | # @return [String] a string representation of the source suitable for UI. 117 | # 118 | def description 119 | strategy = Pod::Downloader.strategy_from_options(download_params) 120 | options = download_params.dup 121 | url = options.delete(strategy) 122 | result = "from `#{url}`" 123 | options.each do |key, value| 124 | result << ", #{key} `#{value}`" 125 | end 126 | result 127 | end 128 | 129 | # Return the normalized path for a pubspec for a relative declared path. 130 | # 131 | # @param [String] declared_path 132 | # The path declared in the podfile. 133 | # 134 | # @return [String] The uri of the pubspec appending the name of the file 135 | # and expanding it if necessary. 136 | # 137 | # @note If the declared path is expanded only if the represents a path 138 | # relative to the file system. 139 | # 140 | def normalized_pubspec_path(declared_path) 141 | Spec.find_file(name, declared_path) 142 | end 143 | 144 | # Return the normalized path for a pubspec assuming sandbox 145 | # pod folder as location. 146 | # 147 | # @return [String] The uri of the pubspec appending the name of the file 148 | # and expanding it if necessary. 149 | # 150 | def normalized_pubspec_path 151 | search_path = params[:path].nil? ? target : File.expand_path(params[:path], target) 152 | Spec.find_file(name, search_path) 153 | end 154 | 155 | private 156 | 157 | # @! Subclasses helpers 158 | 159 | # Pre-downloads a flutter project passing the options to the downloader 160 | # and informing the sandbox. 161 | # 162 | # @param [Pod::Sandbox] sandbox 163 | # The sandbox where the flutter project should be downloaded. 164 | # 165 | # @note To prevent a double download of the repository the flutter project 166 | # is marked as pre-downloaded indicating to the installer that only 167 | # clean operations are needed. 168 | # 169 | # @todo The downloader configuration is the same of the 170 | # #{Pod::Installer::PodSourceInstaller} 171 | # and it needs to be kept in sync. 172 | # 173 | # @return [void] 174 | # 175 | # @todo Implement caching for remote sources. 176 | # 177 | def pre_download(sandbox) 178 | title = "Pre-downloading: `#{name}` #{description}" 179 | Pod::UI.titled_section(title, :verbose_prefix => '-> ') do 180 | begin 181 | download_result = Downloader.download(download_request, target, :can_cache => can_cache) 182 | rescue Pod::DSLError => e 183 | raise Pod::Informative, "Failed to load '#{name}' pubspec: #{e.message}" 184 | rescue => e 185 | raise Pod::Informative, "Failed to download '#{name}': #{e.message}" 186 | end 187 | 188 | # spec = download_result.spec 189 | # raise Pod::Informative, "Unable to find a specification for '#{name}'." unless spec 190 | 191 | # since the podspec might be cleaned, we want the checksum to refer 192 | # to the json in the sandbox 193 | # spec.defined_in_file = nil 194 | 195 | # store_podspec(sandbox, spec) 196 | # sandbox.store_pre_downloaded_pod(name) 197 | # sandbox.store_checkout_source(name, download_result.checkout_options) 198 | end 199 | end 200 | 201 | # @return [Pod::Downloader::Request] the request to remote 202 | # flutter project source. 203 | # 204 | def download_request 205 | Pod::Downloader::Request.new( 206 | :name => name, 207 | :params => download_params, 208 | ) 209 | end 210 | 211 | # @return [Hash] the options for remote source download. 212 | # 213 | def download_params 214 | params.select { |key, value| !key.equal?(:path) } 215 | end 216 | 217 | # @return [String] the path where this flutter project 218 | # will be downloaded relative paths. 219 | # 220 | def target 221 | return Pod::Config.instance.sandbox.pod_dir(name) 222 | end 223 | end 224 | end 225 | end 226 | end -------------------------------------------------------------------------------- /lib/cocoapods-embed-flutter/flutter/pubspec.rb: -------------------------------------------------------------------------------- 1 | require 'cocoapods-embed-flutter/flutter' 2 | require 'yaml' 3 | require 'open3' 4 | require 'concurrent' 5 | require 'cocoapods' 6 | 7 | module Flutter 8 | module Pub 9 | # The Specification provides a DSL to describe a flutter project. 10 | # A project is defined as a library originating from a source. 11 | # A specification can support detailed attributes for modules of code 12 | # through dependencies. 13 | # 14 | # Usually it is stored in `pubspec.yaml` file. 15 | # 16 | class Spec 17 | # @return [String] the path where the specification is defined, if loaded 18 | # from a file. 19 | # 20 | attr_reader :defined_in_file 21 | 22 | # @param [String] path 23 | # the path to the specification. 24 | # 25 | def initialize(path) 26 | @data = YAML.load_file path 27 | @defined_in_file = path 28 | end 29 | 30 | # Returns the path to `pubspec` with the given name and location to search. 31 | # 32 | # @param [String] name 33 | # the name of the project declared in `pubspec`. 34 | # 35 | # @param [String] path 36 | # where project or pubspec is located. 37 | # 38 | # @note either the flutter module or the `pubspec` of the flutter module 39 | # can be in the path. Optionally you can provide the `pubspec` 40 | # file directly. 41 | # 42 | # @return [String] path to the `pubspec` with the given name if present. 43 | # 44 | def self.find_file(name, path) 45 | path = File.expand_path(path, Dir.pwd) 46 | 47 | if File.basename(path) == Pub::SPEC_FILE 48 | return path 49 | elsif Dir.exists?(File.expand_path(name, path)) && 50 | File.exists?(File.expand_path(Pub::SPEC_FILE, File.expand_path(name, path))) 51 | return File.expand_path(Pub::SPEC_FILE, File.expand_path(name, path)) 52 | elsif File.exists?(File.expand_path(Pub::SPEC_FILE, path)) 53 | return File.expand_path(Pub::SPEC_FILE, path) 54 | else 55 | return nil 56 | end 57 | end 58 | 59 | # Returns the path to `pubspec` with the given name and location to search. 60 | # 61 | # @param [String] name 62 | # the name of the project declared in `pubspec`. 63 | # 64 | # @param [String] path 65 | # where project or pubspec is located. 66 | # 67 | # @note either the flutter module or the `pubspec` of the flutter module 68 | # can be in the path. Optionally you can provide the `pubspec` 69 | # file directly. 70 | # 71 | # @return [Spec] the `pubspec` with the given name if present. 72 | # 73 | def self.find(name, path) 74 | pubspec_path = find_file(name, path) 75 | raise StandardError, "Invalid path: '#{path}' for flutter module: '#{name}'." unless pubspec_path 76 | pubspec = Spec.new(pubspec_path) 77 | raise StandardError, "Invalid path: '#{path}' for flutter module: '#{name}'." unless pubspec.name == name 78 | return pubspec 79 | end 80 | 81 | # @return [Boolean] If this specification is a module specification. 82 | # 83 | def module? 84 | return false unless @data.include?(Flutter::NAME) 85 | return @data[Flutter::NAME].is_a?(Hash) && @data[Flutter::NAME].include?('module') 86 | end 87 | 88 | # @return [String] the path to the flutter project. 89 | # 90 | def project_path 91 | File.dirname(defined_in_file) 92 | end 93 | 94 | # @return [String] the path to the flutter project 95 | # dependencies cache file. 96 | # 97 | def package_cache_path 98 | File.join(project_path, Pub::TOOL_DIR, Pub::CACHE_FILE) 99 | end 100 | 101 | # @return [String] the path to the flutter project. 102 | # 103 | def pod_helper_path 104 | File.join(project_path, '.ios', Flutter::DIR_NAME, 'podhelper.rb') if module? 105 | end 106 | 107 | # @return [Array] the list of all the projects this 108 | # specification depends upon and are included in app release. 109 | # 110 | def dependencies 111 | return [] unless @data.include?('dependencies') 112 | Dependency.create_from_hash(@data['dependencies'], self) 113 | end 114 | 115 | # @return [Array] the list of all the projects this 116 | # specification depends upon only during development. 117 | # 118 | def dev_dependencies 119 | return [] unless @data.include?('dev_dependencies') 120 | Dependency.create_from_hash(@data['dev_dependencies'], self) 121 | end 122 | 123 | # @return [Array] the list of all the projects this 124 | # specification depends upon. 125 | # 126 | def all_dependencies 127 | dependencies + dev_dependencies 128 | end 129 | 130 | # Runs `flutter pub get` on project directory concurrently. 131 | # 132 | # @return [Concurrent::Promises::Future, Nil] 133 | # {Nil} if `pub get` running/completed, otherwise 134 | # runs `flutter pub get` task in background 135 | # and returns its future. 136 | # 137 | def pub_get 138 | future = @@current_pubgets[self] 139 | return nil if !future.nil? 140 | future = Concurrent::Promises.future do 141 | stdout, stderr, status = Open3.capture3('flutter pub get', :chdir => self.project_path) 142 | :result 143 | end 144 | @@current_pubgets[self] = future 145 | return Concurrent::Promises.zip(future, *all_dependencies.map(&:install).compact) 146 | end 147 | 148 | # See if two {Spec} instances refer to the same pubspecs. 149 | # 150 | # @return [Boolean] whether or not the two {Spec} instances refer to the 151 | # same projects. 152 | # 153 | def ==(other) 154 | self.class === other && 155 | other.defined_in_file == defined_in_file && 156 | other.instance_variable_get(:@data) == @data 157 | end 158 | 159 | # @return [Fixnum] A hash identical for equals objects. 160 | # 161 | def hash 162 | [defined_in_file, @data].hash 163 | end 164 | 165 | alias eql? == 166 | 167 | # Allows accessing top level values in `pubspec.yaml`, 168 | # i.e. name, description, version etc. 169 | # 170 | # @param [Symbol] m 171 | # top level key value to access, 172 | # i.e. name, description etc. 173 | # 174 | # @return depending on accessed value type in `pubspec.yaml`. 175 | # 176 | # @raise [NoMethodError] if no method or custom attribute exists by 177 | # the attribute name in pubspec. 178 | # 179 | def method_missing(m, *args, &block) 180 | if @data.include?(m.to_s) 181 | return @data[m.to_s] 182 | end 183 | super.method_missing(m, *args, &block) 184 | end 185 | 186 | private 187 | 188 | # A hash containing all `pub get` promises. 189 | @@current_pubgets = {} 190 | end 191 | end 192 | end -------------------------------------------------------------------------------- /lib/cocoapods-embed-flutter/gem_version.rb: -------------------------------------------------------------------------------- 1 | # The CocoapodsEmbedFlutter modules name-spaces 2 | # all the plugin specific classes. 3 | # 4 | module CocoapodsEmbedFlutter 5 | # The version of the cocoapods-embed-flutter. 6 | # 7 | VERSION = '0.6.1'.freeze 8 | end 9 | -------------------------------------------------------------------------------- /lib/cocoapods-embed-flutter/hooks.rb: -------------------------------------------------------------------------------- 1 | require 'cocoapods-embed-flutter/hooks/post_install' 2 | -------------------------------------------------------------------------------- /lib/cocoapods-embed-flutter/hooks/post_install.rb: -------------------------------------------------------------------------------- 1 | module CocoapodsEmbedFlutter 2 | # Registers for CocoaPods plugin hooks 3 | module Hooks 4 | Pod::HooksManager.register('cocoapods-embed-flutter', :post_install) do |installer, options| 5 | # Do nothing 6 | end 7 | end 8 | end -------------------------------------------------------------------------------- /lib/cocoapods-embed-flutter/source.rb: -------------------------------------------------------------------------------- 1 | require 'cocoapods-embed-flutter/src/pub' 2 | -------------------------------------------------------------------------------- /lib/cocoapods-embed-flutter/src/pub.rb: -------------------------------------------------------------------------------- 1 | require 'cocoapods-embed-flutter/gem_version' 2 | require 'cocoapods-embed-flutter/flutter' 3 | 4 | # The Pod modules name-spaces all the classes and methods 5 | # providing flutter specific functionality to podfile. 6 | # 7 | module Pod 8 | # The Podfile is a specification that describes the dependencies of the 9 | # targets of an Xcode project. 10 | # 11 | # It supports its own DSL and is stored in a file named `Podfile`. 12 | # 13 | # The Podfile creates a hierarchy of target definitions that store the 14 | # information necessary to generate the CocoaPods libraries. 15 | # 16 | class Podfile 17 | # The Podfile is a specification that describes the dependencies of the 18 | # targets of one or more Xcode projects. With Embed Flutter 19 | # it is possible to declare flutter module as dependency 20 | # 21 | # A Podfile can be very simple: 22 | # 23 | # target 'MyApp' 24 | # pub 'flutter_module', :path => '../' 25 | # 26 | # An example of a more complex Podfile can be: 27 | # 28 | # platform :ios, '9.0' 29 | # inhibit_all_warnings! 30 | # 31 | # target 'MyApp' do 32 | # pub 'flutter_module', :path => '../' 33 | # end 34 | # 35 | # target 'MyAppTests' do 36 | # pub 'flutter_module_test', :path => '../' 37 | # end 38 | # 39 | # post_install do |installer| 40 | # installer.pods_project.targets.each do |target| 41 | # puts "#{target.name}" 42 | # end 43 | # end 44 | # 45 | # 46 | # @note Currently only one flutter module per target is 47 | # supported. 48 | # 49 | module DSL 50 | # Specifies a flutter module dependency of the project. 51 | # 52 | # A dependency requirement is defined by the name of the module and 53 | # optionally a list of requirements. 54 | # 55 | # 56 | # ### Using the files from a local path. 57 | # 58 | # If you would like to use develop a flutter module in tandem with 59 | # its client project you can use the `path` option. 60 | # 61 | # pub 'flutter_module', :path => '../' 62 | # 63 | # Using this option Embed Flutter will assume the given folder 64 | # to be the root of the flutter module or the root of flutter module `pubspec` file 65 | # or points to the `pubspec` file itself and will link the files directly from there 66 | # in the Pods project. This means that your edits will persist to 67 | # CocoaPods installations. 68 | # 69 | # The referenced folder can be a checkout of your your favourite SCM or 70 | # even a git submodule of the current repository. 71 | # 72 | # Note that either the flutter module or the `pubspec` of the flutter module 73 | # can be in the folder. Optionally you can provide the `pubspec` file directly. 74 | # 75 | # 76 | # ### From a flutter module in the root of a library repository. 77 | # 78 | # Sometimes you may want to use the bleeding edge version of a module. Or a 79 | # specific revision. If this is the case, you can specify that with your 80 | # pub declaration. 81 | # 82 | # To use the `master` or `main` branch of the repository: 83 | # 84 | # pub 'flutter_module', :git => 'https://github.com/octokit/flutter_module.git' 85 | # 86 | # 87 | # To use a different branch of the repository: 88 | # 89 | # pub 'flutter_module', :git => 'https://github.com/octokit/flutter_module.git', :branch => 'dev' 90 | # 91 | # 92 | # To use a tag of the repository: 93 | # 94 | # pub 'flutter_module', :git => 'https://github.com/octokit/flutter_module.git', :tag => '0.7.0' 95 | # 96 | # 97 | # Or specify a commit: 98 | # 99 | # pub 'flutter_module', :git => 'https://github.com/octokit/flutter_module.git', :commit => '082f8319af' 100 | # 101 | # The flutter module or its `pubspec` file is expected to be in the 102 | # root of the repository, if that's not the case specify relative path 103 | # to flutter project in repository. 104 | # 105 | # pub 'flutter_module', :git => 'https://github.com/octokit/flutter_module.git', :tag => '0.7.0', :path => 'custom/flutter_module' 106 | # 107 | # 108 | # @note This method allow a nil name and the raises to be more 109 | # informative. 110 | # 111 | # @return [void] 112 | # 113 | def pub(name = nil, *requirements) 114 | pubspec = Flutter::Pub::ExternalSources.fetchWithNameAndOptions(name, requirements) 115 | Pod::UI.titled_section("Installing flutter dependencies for #{name}...", :verbose_prefix => '-> ') do 116 | future = pubspec.pub_get 117 | future.value! if !future.nil? 118 | end 119 | raise StandardError, "Invalid flutter module: '#{name}'." unless File.exists?(pubspec.pod_helper_path) 120 | install_flutter_pods_for_pubspec(pubspec) 121 | end 122 | 123 | # Integrates flutter module provided in `pubspec` 124 | # to an Xcode project target. 125 | # 126 | # @param [Flutter::Pub::Spec] pubspec 127 | # the flutter module project specification. 128 | # 129 | # @return [void] 130 | # 131 | def install_flutter_pods_for_pubspec(pubspec) 132 | raise ArgumentError, "Invalid `pubspec` argument." unless pubspec.is_a?(Flutter::Pub::Spec) 133 | load pubspec.pod_helper_path 134 | install_all_flutter_pods(pubspec.project_path) 135 | end 136 | end 137 | end 138 | end -------------------------------------------------------------------------------- /lib/cocoapods_plugin.rb: -------------------------------------------------------------------------------- 1 | require 'cocoapods-embed-flutter' 2 | -------------------------------------------------------------------------------- /spec/info_spec.rb: -------------------------------------------------------------------------------- 1 | require_relative 'spec_helper' 2 | 3 | describe 'Plugin info test' do 4 | it 'checks name' do 5 | ''.should.equal '' 6 | end 7 | end -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'pathname' 2 | ROOT = Pathname.new(File.expand_path('../../', __FILE__)) 3 | $:.unshift((ROOT + 'lib').to_s) 4 | $:.unshift((ROOT + 'spec').to_s) 5 | 6 | require 'bundler/setup' 7 | require 'bacon' 8 | require 'mocha-on-bacon' 9 | require 'pretty_bacon' 10 | require 'pathname' 11 | require 'cocoapods' 12 | 13 | Mocha.configure { |c| c.stubbing_non_existent_method = :prevent } 14 | 15 | require 'cocoapods_plugin' 16 | 17 | #-----------------------------------------------------------------------------# 18 | 19 | module Pod 20 | 21 | # Disable the wrapping so the output is deterministic in the tests. 22 | # 23 | UI.disable_wrap = true 24 | 25 | # Redirects the messages to an internal store. 26 | # 27 | module UI 28 | @output = '' 29 | @warnings = '' 30 | 31 | class << self 32 | attr_accessor :output 33 | attr_accessor :warnings 34 | 35 | def puts(message = '') 36 | @output << "#{message}\n" 37 | end 38 | 39 | def warn(message = '', actions = []) 40 | @warnings << "#{message}\n" 41 | end 42 | 43 | def print(message) 44 | @output << message 45 | end 46 | end 47 | end 48 | end 49 | 50 | #-----------------------------------------------------------------------------# 51 | --------------------------------------------------------------------------------