motion-cross-platform 1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 56c3e353042268f94150b0dd2f0852e576ab0c2944dc5336d55a6647aef9c907
4
+ data.tar.gz: 00bf2f4df6eeef0eb6ed01d926bc3ac807dc22b18af356b15edac1aa0334e027
5
+ SHA512:
6
+ metadata.gz: 7073a861a06f8723e971c747cf650cd867e2e363a2d6c25eb377476c440439e6661aed9146b0cfcb4b62d375454199131e765449523e64c9cc518e03997988c4
7
+ data.tar.gz: cd72e96c1a74b08bedb3b234037321ce1984644e941ec29125f1697ed443640413459f8f84f116a912681aee72b50f9ebacbb5a712f44f8e270c1675428839fd
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # motion-cross-platform
2
+
3
+ Provides a common starting point for cross-platform RubyMotion gems and applications.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'motion-cross-platform'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install motion-cross-platform
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
@@ -0,0 +1,17 @@
1
+ # encoding: utf-8
2
+
3
+ require "motion/project/template/android"
4
+ begin
5
+ require "motion-gradle"
6
+ rescue LoadError
7
+ end
8
+
9
+ Motion::Project::App.setup do |app|
10
+ app.build_dir = "build/android"
11
+ app.assets_dirs << "resources"
12
+ app.resources_dirs = []
13
+
14
+ app.files.delete_if { path.start_with?("./app/ios") }
15
+ app.files.delete_if { path.start_with?("./app/osx") }
16
+ app.files.delete_if { path.start_with?("./app/cocoa") }
17
+ end
@@ -0,0 +1,14 @@
1
+ # encoding: utf-8
2
+
3
+ module Motion
4
+ module Project
5
+ class Config
6
+ # Allows us to define the config in one file but only
7
+ # execute it when it matches the specified platform.
8
+ def platform(platform_name)
9
+ return unless platform_name.to_sym == template
10
+ yield
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,19 @@
1
+ # encoding: utf-8
2
+
3
+ def define_rake_tasks(data)
4
+ data.each do |platform, tasks|
5
+ namespace platform do
6
+ tasks.each do |name, description|
7
+ desc description
8
+ task name do
9
+ invoke_rake platform, name
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
15
+
16
+ def invoke_rake(platform, task)
17
+ trace = Rake.application.options.trace == true
18
+ system "platform=#{platform} bundle exec rake \"#{task}\" #{trace ? "--trace" : ""}" or exit 1
19
+ end
@@ -0,0 +1,12 @@
1
+ # encoding: utf-8
2
+
3
+ require "motion/project/template/ios"
4
+ begin
5
+ require "motion-cocoapods"
6
+ rescue LoadError
7
+ end
8
+
9
+ Motion::Project::App.setup do |app|
10
+ app.files.delete_if { path.start_with?("./app/android") }
11
+ app.files.delete_if { path.start_with?("./app/osx") }
12
+ end
@@ -0,0 +1,12 @@
1
+ # encoding: utf-8
2
+
3
+ require "motion/project/template/osx"
4
+ begin
5
+ require "motion-cocoapods"
6
+ rescue LoadError
7
+ end
8
+
9
+ Motion::Project::App.setup do |app|
10
+ app.files.delete_if { path.start_with?("./app/android") }
11
+ app.files.delete_if { path.start_with?("./app/ios") }
12
+ end
@@ -0,0 +1,95 @@
1
+ # encoding: utf-8
2
+
3
+ if platform = ENV["platform"]
4
+ require_relative "config"
5
+ require_relative "#{platform}_setup"
6
+ else
7
+ require_relative "stubs"
8
+ require_relative "helpers"
9
+
10
+ define_rake_tasks(
11
+ android: {
12
+ "build" => "Create an application package file (.apk)",
13
+ "clean" => "Clear local build objects",
14
+ "clean:all" => "Clean all build objects",
15
+ "config" => "Show project config",
16
+ "ctags" => "Generate ctags",
17
+ "default" => "Same as emulator",
18
+ "device" => "Build the app then run it on the device",
19
+ "device:install" => "Install the app on the device",
20
+ "device:start" => "Start the app's main intent on the device",
21
+ "emulator" => "Build the app then run it in the emulator",
22
+ "emulator:install" => "Install the app in the emulator",
23
+ "emulator:start" => "Start the app's main intent in the emulator",
24
+ "release" => "Create an application package file (.apk) for release (Google Play)",
25
+ "spec" => "Same as spec:emulator",
26
+ "spec:device" => "Run the test/spec suite on the device",
27
+ "spec:emulator" => "Run the test/spec suite in the emulator",
28
+ "gradle:install" => "Download and build dependencies"
29
+ },
30
+ ios: {
31
+ "archive" => "Create an .ipa archive",
32
+ "archive:distribution" => "Create an .ipa archive for distribution (AppStore)",
33
+ "build" => "Build everything",
34
+ "build:device" => "Build the device version",
35
+ "build:simulator" => "Build the simulator version",
36
+ "clean" => "Clear local build objects",
37
+ "clean:all" => "Clean all build objects",
38
+ "config" => "Show project config",
39
+ "crashlog" => "Same as crashlog:simulator",
40
+ "crashlog:device" => "Retrieve and symbolicate crash logs generated by the app on the device, and open the latest generated one",
41
+ "crashlog:simulator" => "Open the latest crash report generated by the app in the simulator",
42
+ "ctags" => "Generate ctags",
43
+ "default" => "Build the project, then run the simulator",
44
+ "device" => "Deploy on the device",
45
+ "profile" => "Same as profile:simulator",
46
+ "profile:device" => "Run a build on the device through Instruments",
47
+ "profile:device:templates" => "List all built-in device Instruments templates",
48
+ "profile:simulator" => "Run a build on the simulator through Instruments",
49
+ "profile:simulator:templates" => "List all built-in Simulator Instruments templates",
50
+ "simulator" => "Run the simulator",
51
+ "spec" => "Same as spec:simulator",
52
+ "spec:device" => "Run the test/spec suite on the device",
53
+ "spec:simulator" => "Run the test/spec suite in the simulator",
54
+ "static" => "Create a .a static library",
55
+ "watch" => "Same as watch:simulator",
56
+ "watch:simulator" => "Run the Watch application on the simulator"
57
+ },
58
+ osx: {
59
+ "archive" => "Create a .pkg archive",
60
+ "archive:distribution" => "Create a .pkg archive for distribution (AppStore)",
61
+ "build" => "Build the project for development",
62
+ "build:release" => "Build the project for release",
63
+ "clean" => "Clear local build objects",
64
+ "config" => "Show project config",
65
+ "crashlog" => "Open the latest crash report generated for the app",
66
+ "default" => "Build the project, then run the app",
67
+ "run" => "Run the project",
68
+ "spec" => "Run the test/spec suite",
69
+ "static" => "Create a .a static library"
70
+ }
71
+ )
72
+
73
+ desc "Start a combined iOS/Android REPL"
74
+ task "super_repl" do
75
+ require "readline"
76
+
77
+ cmd = %w{ rake }
78
+ ios_cmd = cmd + ["ios:simulator"]
79
+ android_cmd = cmd + ["android:emulator:start"]
80
+
81
+ if ENV.fetch("skip_build", nil)
82
+ ios_cmd << "skip_build=1"
83
+ android_cmd << "skip_build=1"
84
+ end
85
+
86
+ ios_io = IO.popen(ios_cmd.join(" "), "w")
87
+ android_io = IO.popen(android_cmd.join(" "), "w")
88
+
89
+ while expr = Readline.readline("> ", true)
90
+ ios_io.puts expr
91
+ android_io.puts expr
92
+ sleep 0.2
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,20 @@
1
+ module Motion
2
+ module Project
3
+ class Config
4
+ end
5
+ end
6
+ end
7
+
8
+ module Motion
9
+ module Project
10
+ class App
11
+ def template
12
+ :cross_platform
13
+ end
14
+
15
+ def self.setup
16
+ # no-op: allows this method to be called without raising an error
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1 @@
1
+ require_relative "cross_platform/rake_tasks"
@@ -0,0 +1,3 @@
1
+ # encoding: utf-8
2
+
3
+ require_relative "motion/project/cross_platform/rake_tasks"
metadata ADDED
@@ -0,0 +1,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: motion-cross-platform
3
+ version: !ruby/object:Gem::Version
4
+ version: '1.0'
5
+ platform: ruby
6
+ authors:
7
+ - Andrew Havens
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-03-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: Provides a common starting point for cross-platform RubyMotion gems and
28
+ applications.
29
+ email:
30
+ - email@andrewhavens.com
31
+ executables: []
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - README.md
36
+ - lib/motion-cross-platform.rb
37
+ - lib/motion/project/cross_platform.rb
38
+ - lib/motion/project/cross_platform/android_setup.rb
39
+ - lib/motion/project/cross_platform/config.rb
40
+ - lib/motion/project/cross_platform/helpers.rb
41
+ - lib/motion/project/cross_platform/ios_setup.rb
42
+ - lib/motion/project/cross_platform/osx_setup.rb
43
+ - lib/motion/project/cross_platform/rake_tasks.rb
44
+ - lib/motion/project/cross_platform/stubs.rb
45
+ homepage: https://github.com/rubymotion-community/motion-cross-platform
46
+ licenses:
47
+ - MIT
48
+ metadata: {}
49
+ post_install_message:
50
+ rdoc_options: []
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ requirements: []
64
+ rubygems_version: 3.4.22
65
+ signing_key:
66
+ specification_version: 4
67
+ summary: Provides a common starting point for cross-platform RubyMotion gems and applications.
68
+ test_files: []