robotkit 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/bin/console +2 -5
  4. data/exe/robokit +5 -0
  5. data/fixtures/build.gradle +19 -0
  6. data/fixtures/gradle/wrapper/gradle-wrapper.jar +0 -0
  7. data/fixtures/gradle/wrapper/gradle-wrapper.properties +6 -0
  8. data/fixtures/gradle.properties +12 -0
  9. data/fixtures/gradlew +160 -0
  10. data/fixtures/gradlew.bat +90 -0
  11. data/fixtures/settings.gradle.erb +1 -0
  12. data/fixtures/{library_module}/.gitignore +1 -0
  13. data/fixtures/{library_module}/build.gradle +16 -0
  14. data/fixtures/{library_module}/proguard-rules.pro +17 -0
  15. data/fixtures/{library_module}/src/main/AndroidManifest.xml.erb +7 -0
  16. data/fixtures/{library_module}/src/main/java/{library_package}/.gitkeep +0 -0
  17. data/fixtures/{library_module}/src/main/res/values/strings.xml.erb +3 -0
  18. data/fixtures/{sample_module}/.gitignore +1 -0
  19. data/fixtures/{sample_module}/build.gradle.erb +25 -0
  20. data/fixtures/{sample_module}/proguard-rules.pro +17 -0
  21. data/fixtures/{sample_module}/src/main/AndroidManifest.xml.erb +16 -0
  22. data/fixtures/{sample_module}/src/main/java/{sample_package}/MainActivity.java.erb +13 -0
  23. data/fixtures/{sample_module}/src/main/java/{sample_package}/SampleApplication.java.erb +11 -0
  24. data/fixtures/{sample_module}/src/main/res/layout/activity_main.xml +15 -0
  25. data/fixtures/{sample_module}/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  26. data/fixtures/{sample_module}/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  27. data/fixtures/{sample_module}/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  28. data/fixtures/{sample_module}/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  29. data/fixtures/{sample_module}/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  30. data/fixtures/{sample_module}/src/main/res/values/colors.xml +6 -0
  31. data/fixtures/{sample_module}/src/main/res/values/dimens.xml +4 -0
  32. data/fixtures/{sample_module}/src/main/res/values/strings.xml.erb +3 -0
  33. data/fixtures/{sample_module}/src/main/res/values/styles.xml +7 -0
  34. data/lib/robotkit/cli.rb +65 -0
  35. data/lib/robotkit/version.rb +1 -1
  36. data/lib/robotkit.rb +1 -1
  37. data/robotkit.gemspec +2 -0
  38. metadata +48 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '09c4f79b1d898c772ab1a64102fb3ef1ef8da9e2'
4
- data.tar.gz: 4a334423dde4c863f1498f1c4c7cf0220e515b9a
3
+ metadata.gz: 983464e8582bd76351847c6967eef7c281a57f2e
4
+ data.tar.gz: 6daabeef219d229d4dd01fa3fa4119a1824ebd31
5
5
  SHA512:
6
- metadata.gz: fc53175b5d824a93023bc697bbe447d2b4804b899fca55592e0974666a8eea9062eeeeb00714ff7ea35b01831f280138226027c370339967ef2fcec37365dbff
7
- data.tar.gz: 2de56b9b03689cdb39226fe115f5caf099a37a7d2d2a43ab5b8926ecd1bd20ec97cc1667089408ae77ec66a7c5b74451817f72c04565514d1370a15330daa2fe
6
+ metadata.gz: 927e252b7d3ebc45a3959e2d10fcaaa3543c9fcbfc5e5127a7c5fb46b84e0ca56f441df4ad7e9ef3e420bdef51bd292af6de964c29d62a161e0bd558fbf7faa9
7
+ data.tar.gz: 4946b6917485714e40362536e8ce69195d74ff6f717768a8ef13b44d1e70355a0d86005209978b6f9120771711a542248e47cde167e13dbad425e942b27e6eea
data/Gemfile CHANGED
@@ -2,3 +2,4 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in robotkit.gemspec
4
4
  gemspec
5
+ gem "pry"
data/bin/console CHANGED
@@ -6,9 +6,6 @@ require "robotkit"
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
8
8
 
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
9
+ require "pry"
10
+ Pry.start
12
11
 
13
- require "irb"
14
- IRB.start
data/exe/robokit ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "robotkit"
4
+
5
+ Robotkit::CLI.start
@@ -0,0 +1,19 @@
1
+ buildscript {
2
+ repositories {
3
+ jcenter()
4
+ }
5
+ dependencies {
6
+ classpath 'com.android.tools.build:gradle:2.2.3'
7
+ classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
8
+ }
9
+ }
10
+
11
+ allprojects {
12
+ repositories {
13
+ jcenter()
14
+ }
15
+ }
16
+
17
+ task clean(type: Delete) {
18
+ delete rootProject.buildDir
19
+ }
@@ -0,0 +1,6 @@
1
+ #Mon Dec 28 10:00:20 PST 2015
2
+ distributionBase=GRADLE_USER_HOME
3
+ distributionPath=wrapper/dists
4
+ zipStoreBase=GRADLE_USER_HOME
5
+ zipStorePath=wrapper/dists
6
+ distributionUrl=https\://services.gradle.org/distributions/gradle-3.2-all.zip
@@ -0,0 +1,12 @@
1
+ # Project-wide Gradle settings.
2
+ # IDE (e.g. Android Studio) users:
3
+ # Gradle settings configured through the IDE *will override*
4
+ # any settings specified in this file.
5
+
6
+ # For more details on how to configure your build environment visit
7
+ # http://www.gradle.org/docs/current/userguide/build_environment.html
8
+
9
+ org.gradle.daemon=true
10
+ org.gradle.jvmargs=-Xmx4096M
11
+ org.gradle.parallel=true
12
+ org.gradle.configureondemand=true
data/fixtures/gradlew ADDED
@@ -0,0 +1,160 @@
1
+ #!/usr/bin/env bash
2
+
3
+ ##############################################################################
4
+ ##
5
+ ## Gradle start up script for UN*X
6
+ ##
7
+ ##############################################################################
8
+
9
+ # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10
+ DEFAULT_JVM_OPTS=""
11
+
12
+ APP_NAME="Gradle"
13
+ APP_BASE_NAME=`basename "$0"`
14
+
15
+ # Use the maximum available, or set MAX_FD != -1 to use that value.
16
+ MAX_FD="maximum"
17
+
18
+ warn ( ) {
19
+ echo "$*"
20
+ }
21
+
22
+ die ( ) {
23
+ echo
24
+ echo "$*"
25
+ echo
26
+ exit 1
27
+ }
28
+
29
+ # OS specific support (must be 'true' or 'false').
30
+ cygwin=false
31
+ msys=false
32
+ darwin=false
33
+ case "`uname`" in
34
+ CYGWIN* )
35
+ cygwin=true
36
+ ;;
37
+ Darwin* )
38
+ darwin=true
39
+ ;;
40
+ MINGW* )
41
+ msys=true
42
+ ;;
43
+ esac
44
+
45
+ # Attempt to set APP_HOME
46
+ # Resolve links: $0 may be a link
47
+ PRG="$0"
48
+ # Need this for relative symlinks.
49
+ while [ -h "$PRG" ] ; do
50
+ ls=`ls -ld "$PRG"`
51
+ link=`expr "$ls" : '.*-> \(.*\)$'`
52
+ if expr "$link" : '/.*' > /dev/null; then
53
+ PRG="$link"
54
+ else
55
+ PRG=`dirname "$PRG"`"/$link"
56
+ fi
57
+ done
58
+ SAVED="`pwd`"
59
+ cd "`dirname \"$PRG\"`/" >/dev/null
60
+ APP_HOME="`pwd -P`"
61
+ cd "$SAVED" >/dev/null
62
+
63
+ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64
+
65
+ # Determine the Java command to use to start the JVM.
66
+ if [ -n "$JAVA_HOME" ] ; then
67
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68
+ # IBM's JDK on AIX uses strange locations for the executables
69
+ JAVACMD="$JAVA_HOME/jre/sh/java"
70
+ else
71
+ JAVACMD="$JAVA_HOME/bin/java"
72
+ fi
73
+ if [ ! -x "$JAVACMD" ] ; then
74
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75
+
76
+ Please set the JAVA_HOME variable in your environment to match the
77
+ location of your Java installation."
78
+ fi
79
+ else
80
+ JAVACMD="java"
81
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82
+
83
+ Please set the JAVA_HOME variable in your environment to match the
84
+ location of your Java installation."
85
+ fi
86
+
87
+ # Increase the maximum file descriptors if we can.
88
+ if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89
+ MAX_FD_LIMIT=`ulimit -H -n`
90
+ if [ $? -eq 0 ] ; then
91
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92
+ MAX_FD="$MAX_FD_LIMIT"
93
+ fi
94
+ ulimit -n $MAX_FD
95
+ if [ $? -ne 0 ] ; then
96
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
97
+ fi
98
+ else
99
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100
+ fi
101
+ fi
102
+
103
+ # For Darwin, add options to specify how the application appears in the dock
104
+ if $darwin; then
105
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106
+ fi
107
+
108
+ # For Cygwin, switch paths to Windows format before running java
109
+ if $cygwin ; then
110
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112
+ JAVACMD=`cygpath --unix "$JAVACMD"`
113
+
114
+ # We build the pattern for arguments to be converted via cygpath
115
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116
+ SEP=""
117
+ for dir in $ROOTDIRSRAW ; do
118
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
119
+ SEP="|"
120
+ done
121
+ OURCYGPATTERN="(^($ROOTDIRS))"
122
+ # Add a user-defined pattern to the cygpath arguments
123
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125
+ fi
126
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
127
+ i=0
128
+ for arg in "$@" ; do
129
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131
+
132
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134
+ else
135
+ eval `echo args$i`="\"$arg\""
136
+ fi
137
+ i=$((i+1))
138
+ done
139
+ case $i in
140
+ (0) set -- ;;
141
+ (1) set -- "$args0" ;;
142
+ (2) set -- "$args0" "$args1" ;;
143
+ (3) set -- "$args0" "$args1" "$args2" ;;
144
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150
+ esac
151
+ fi
152
+
153
+ # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154
+ function splitJvmOpts() {
155
+ JVM_OPTS=("$@")
156
+ }
157
+ eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158
+ JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159
+
160
+ exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
@@ -0,0 +1,90 @@
1
+ @if "%DEBUG%" == "" @echo off
2
+ @rem ##########################################################################
3
+ @rem
4
+ @rem Gradle startup script for Windows
5
+ @rem
6
+ @rem ##########################################################################
7
+
8
+ @rem Set local scope for the variables with windows NT shell
9
+ if "%OS%"=="Windows_NT" setlocal
10
+
11
+ @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12
+ set DEFAULT_JVM_OPTS=
13
+
14
+ set DIRNAME=%~dp0
15
+ if "%DIRNAME%" == "" set DIRNAME=.
16
+ set APP_BASE_NAME=%~n0
17
+ set APP_HOME=%DIRNAME%
18
+
19
+ @rem Find java.exe
20
+ if defined JAVA_HOME goto findJavaFromJavaHome
21
+
22
+ set JAVA_EXE=java.exe
23
+ %JAVA_EXE% -version >NUL 2>&1
24
+ if "%ERRORLEVEL%" == "0" goto init
25
+
26
+ echo.
27
+ echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28
+ echo.
29
+ echo Please set the JAVA_HOME variable in your environment to match the
30
+ echo location of your Java installation.
31
+
32
+ goto fail
33
+
34
+ :findJavaFromJavaHome
35
+ set JAVA_HOME=%JAVA_HOME:"=%
36
+ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37
+
38
+ if exist "%JAVA_EXE%" goto init
39
+
40
+ echo.
41
+ echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42
+ echo.
43
+ echo Please set the JAVA_HOME variable in your environment to match the
44
+ echo location of your Java installation.
45
+
46
+ goto fail
47
+
48
+ :init
49
+ @rem Get command-line arguments, handling Windowz variants
50
+
51
+ if not "%OS%" == "Windows_NT" goto win9xME_args
52
+ if "%@eval[2+2]" == "4" goto 4NT_args
53
+
54
+ :win9xME_args
55
+ @rem Slurp the command line arguments.
56
+ set CMD_LINE_ARGS=
57
+ set _SKIP=2
58
+
59
+ :win9xME_args_slurp
60
+ if "x%~1" == "x" goto execute
61
+
62
+ set CMD_LINE_ARGS=%*
63
+ goto execute
64
+
65
+ :4NT_args
66
+ @rem Get arguments from the 4NT Shell from JP Software
67
+ set CMD_LINE_ARGS=%$
68
+
69
+ :execute
70
+ @rem Setup the command line
71
+
72
+ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73
+
74
+ @rem Execute Gradle
75
+ "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76
+
77
+ :end
78
+ @rem End local scope for the variables with windows NT shell
79
+ if "%ERRORLEVEL%"=="0" goto mainEnd
80
+
81
+ :fail
82
+ rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83
+ rem the _cmd.exe /c_ return code!
84
+ if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85
+ exit /b 1
86
+
87
+ :mainEnd
88
+ if "%OS%"=="Windows_NT" endlocal
89
+
90
+ :omega
@@ -0,0 +1 @@
1
+ include ':sample', ':<%= library_module %>'
@@ -0,0 +1 @@
1
+ /build
@@ -0,0 +1,16 @@
1
+ apply plugin: 'com.android.library'
2
+ apply plugin: 'com.github.dcendents.android-maven'
3
+
4
+ android {
5
+ compileSdkVersion 25
6
+ buildToolsVersion "25.0.0"
7
+ defaultConfig {
8
+ minSdkVersion 15
9
+ targetSdkVersion 25
10
+ versionCode 1
11
+ versionName "1.0"
12
+ }
13
+ }
14
+
15
+ dependencies {
16
+ }
@@ -0,0 +1,17 @@
1
+ # Add project specific ProGuard rules here.
2
+ # By default, the flags in this file are appended to flags specified
3
+ # in /Users/kazukiyoshida/Library/Android/sdk/tools/proguard/proguard-android.txt
4
+ # You can edit the include path and order by changing the proguardFiles
5
+ # directive in build.gradle.
6
+ #
7
+ # For more details, see
8
+ # http://developer.android.com/guide/developing/tools/proguard.html
9
+
10
+ # Add any project specific keep options here:
11
+
12
+ # If your project uses WebView with JS, uncomment the following
13
+ # and specify the fully qualified class name to the JavaScript interface
14
+ # class:
15
+ #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16
+ # public *;
17
+ #}
@@ -0,0 +1,7 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="<%= library_package_name %>">
3
+
4
+ <application
5
+ android:label="@string/app_name" />
6
+
7
+ </manifest>
@@ -0,0 +1,3 @@
1
+ <resources>
2
+ <string name="app_name"><%= library_module %></string>
3
+ </resources>
@@ -0,0 +1 @@
1
+ /build
@@ -0,0 +1,25 @@
1
+ apply plugin: 'com.android.application'
2
+
3
+ android {
4
+ compileSdkVersion 25
5
+ buildToolsVersion "25.0.0"
6
+ defaultConfig {
7
+ applicationId "<%= sample_package_name %>"
8
+ minSdkVersion 15
9
+ targetSdkVersion 25
10
+ versionCode 1
11
+ versionName "1.0"
12
+ jackOptions {
13
+ enabled true
14
+ }
15
+ }
16
+ compileOptions {
17
+ sourceCompatibility JavaVersion.VERSION_1_8
18
+ targetCompatibility JavaVersion.VERSION_1_8
19
+ }
20
+ }
21
+
22
+ dependencies {
23
+ compile 'com.android.support:appcompat-v7:25.1.0'
24
+ compile project(':<%= library_module%>')
25
+ }
@@ -0,0 +1,17 @@
1
+ # Add project specific ProGuard rules here.
2
+ # By default, the flags in this file are appended to flags specified
3
+ # in /Users/kazukiyoshida/Library/Android/sdk/tools/proguard/proguard-android.txt
4
+ # You can edit the include path and order by changing the proguardFiles
5
+ # directive in build.gradle.
6
+ #
7
+ # For more details, see
8
+ # http://developer.android.com/guide/developing/tools/proguard.html
9
+
10
+ # Add any project specific keep options here:
11
+
12
+ # If your project uses WebView with JS, uncomment the following
13
+ # and specify the fully qualified class name to the JavaScript interface
14
+ # class:
15
+ #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16
+ # public *;
17
+ #}
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ package="<%= sample_package_name %>">
4
+ <application
5
+ android:name=".SampleApplication"
6
+ android:icon="@mipmap/ic_launcher"
7
+ android:label="@string/app_name"
8
+ android:theme="@style/AppTheme">
9
+ <activity android:name=".MainActivity">
10
+ <intent-filter>
11
+ <action android:name="android.intent.action.MAIN" />
12
+ <category android:name="android.intent.category.LAUNCHER" />
13
+ </intent-filter>
14
+ </activity>
15
+ </application>
16
+ </manifest>
@@ -0,0 +1,13 @@
1
+ package <%= sample_package_name %>;
2
+
3
+ import android.support.v7.app.AppCompatActivity;
4
+ import android.os.Bundle;
5
+
6
+ public class MainActivity extends AppCompatActivity {
7
+
8
+ @Override
9
+ protected void onCreate(Bundle savedInstanceState) {
10
+ super.onCreate(savedInstanceState);
11
+ setContentView(R.layout.activity_main);
12
+ }
13
+ }
@@ -0,0 +1,11 @@
1
+ package <%= sample_package_name %>;
2
+
3
+ import android.app.Application;
4
+
5
+ public class SampleApplication extends Application {
6
+
7
+ @Override
8
+ public void onCreate() {
9
+ super.onCreate();
10
+ }
11
+ }
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:id="@+id/activity_main"
4
+ android:layout_width="match_parent"
5
+ android:layout_height="match_parent"
6
+ android:paddingBottom="@dimen/activity_vertical_margin"
7
+ android:paddingLeft="@dimen/activity_horizontal_margin"
8
+ android:paddingRight="@dimen/activity_horizontal_margin"
9
+ android:paddingTop="@dimen/activity_vertical_margin">
10
+ <TextView
11
+ android:id="@+id/text_view"
12
+ android:layout_width="wrap_content"
13
+ android:layout_height="wrap_content"
14
+ android:text="Hello World!" />
15
+ </RelativeLayout>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <resources>
3
+ <color name="colorPrimary">#3F51B5</color>
4
+ <color name="colorPrimaryDark">#303F9F</color>
5
+ <color name="colorAccent">#FF4081</color>
6
+ </resources>
@@ -0,0 +1,4 @@
1
+ <resources>
2
+ <dimen name="activity_horizontal_margin">16dp</dimen>
3
+ <dimen name="activity_vertical_margin">16dp</dimen>
4
+ </resources>
@@ -0,0 +1,3 @@
1
+ <resources>
2
+ <string name="app_name"><%= sample_module %></string>
3
+ </resources>
@@ -0,0 +1,7 @@
1
+ <resources>
2
+ <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
3
+ <item name="colorPrimary">@color/colorPrimary</item>
4
+ <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
5
+ <item name="colorAccent">@color/colorAccent</item>
6
+ </style>
7
+ </resources>
@@ -0,0 +1,65 @@
1
+ require 'robotkit'
2
+ require 'thor'
3
+ require "fileutils"
4
+ require "erb"
5
+
6
+ module Robotkit
7
+ class CLI < Thor
8
+ desc "create :project_name --package com.github.library", "Create Android project"
9
+ option :package, required: true
10
+ option :library_module
11
+ option :sample_module
12
+ option :fixtures_dir
13
+ def create(project_name)
14
+ puts project_name
15
+ Robotkit.exec(options.merge({output_dir: project_name}))
16
+ end
17
+ end
18
+
19
+ def self.exec(params)
20
+ sample_package_name = "#{params[:package]}.sample"
21
+ library_package_name = params[:package]
22
+ library_module = params[:library_module] || "library"
23
+ sample_module = params[:sample_module] || "sample"
24
+ fixtures_dir = params[:fixtures_dir] || "fixtures"
25
+ output_dir = params[:output_dir]
26
+
27
+ # copy from fixtues dir to output dir
28
+ FileUtils.mkdir(output_dir)
29
+ Dir.foreach(fixtures_dir).reject{|it| it.start_with?(".")}.each do |item|
30
+ FileUtils.rm("#{output_dir}/#{item}", {force: true})
31
+ FileUtils.cp_r("#{fixtures_dir}/#{item}", "#{output_dir}/#{item}", {preserve: true, dereference_root: true})
32
+ end
33
+
34
+ # change sample module dir
35
+ File.rename("#{output_dir}/{sample_module}", "#{output_dir}/#{sample_module}")
36
+ # change lib module dir
37
+ File.rename("#{output_dir}/{library_module}", "#{output_dir}/#{library_module}")
38
+
39
+ # create lib package dir
40
+ FileUtils.mkdir_p("#{output_dir}/#{library_module}/src/main/java/#{library_package_name.gsub('.','/')}")
41
+ FileUtils.rm_rf("#{output_dir}/#{library_module}/src/main/java/{library_package}")
42
+
43
+ # create sample package dir
44
+ sample_package_src = "#{output_dir}/#{sample_module}/src/main/java/#{sample_package_name.gsub('.','/')}"
45
+ FileUtils.mkdir_p(sample_package_src)
46
+ sample_files = %w(MainActivity SampleApplication)
47
+ sample_files.each do |file_name|
48
+ File.open("#{sample_package_src}/#{file_name}.java", "w") do |file|
49
+ result = ERB.new(File.open("#{output_dir}/#{sample_module}/src/main/java/{sample_package}/#{file_name}.java.erb").read).result(binding)
50
+ file.write(result)
51
+ end
52
+ end
53
+ FileUtils.rm_rf("#{output_dir}/#{sample_module}/src/main/java/{sample_package}")
54
+
55
+ #eval erb
56
+ Dir.glob("#{output_dir}/**/*").select{|it| it.end_with?("erb")}.each do |path|
57
+ result = ERB.new(File.open(path).read).result(binding)
58
+ File.open(path.sub(".erb", ""), "w") do |file|
59
+ file.write(result)
60
+ end
61
+ File.delete(path)
62
+ end
63
+
64
+ end
65
+ end
@@ -1,3 +1,3 @@
1
1
  module Robotkit
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/robotkit.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require "robotkit/version"
2
+ require "robotkit/cli"
2
3
 
3
4
  module Robotkit
4
- # Your code goes here...
5
5
  end
data/robotkit.gemspec CHANGED
@@ -21,6 +21,8 @@ Gem::Specification.new do |spec|
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ["lib"]
23
23
 
24
+ spec.add_dependency 'thor'
25
+
24
26
  spec.add_development_dependency "bundler", "~> 1.13"
25
27
  spec.add_development_dependency "rake", "~> 10.0"
26
28
  spec.add_development_dependency "rspec", "~> 3.0"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: robotkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kazuki-yoshida
@@ -10,6 +10,20 @@ bindir: exe
10
10
  cert_chain: []
11
11
  date: 2017-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -55,7 +69,8 @@ dependencies:
55
69
  description: You do only type package name.
56
70
  email:
57
71
  - kzk.yshd@gmail.com
58
- executables: []
72
+ executables:
73
+ - robokit
59
74
  extensions: []
60
75
  extra_rdoc_files: []
61
76
  files:
@@ -69,7 +84,38 @@ files:
69
84
  - Rakefile
70
85
  - bin/console
71
86
  - bin/setup
87
+ - exe/robokit
88
+ - fixtures/build.gradle
89
+ - fixtures/gradle.properties
90
+ - fixtures/gradle/wrapper/gradle-wrapper.jar
91
+ - fixtures/gradle/wrapper/gradle-wrapper.properties
92
+ - fixtures/gradlew
93
+ - fixtures/gradlew.bat
94
+ - fixtures/settings.gradle.erb
95
+ - fixtures/{library_module}/.gitignore
96
+ - fixtures/{library_module}/build.gradle
97
+ - fixtures/{library_module}/proguard-rules.pro
98
+ - fixtures/{library_module}/src/main/AndroidManifest.xml.erb
99
+ - fixtures/{library_module}/src/main/java/{library_package}/.gitkeep
100
+ - fixtures/{library_module}/src/main/res/values/strings.xml.erb
101
+ - fixtures/{sample_module}/.gitignore
102
+ - fixtures/{sample_module}/build.gradle.erb
103
+ - fixtures/{sample_module}/proguard-rules.pro
104
+ - fixtures/{sample_module}/src/main/AndroidManifest.xml.erb
105
+ - fixtures/{sample_module}/src/main/java/{sample_package}/MainActivity.java.erb
106
+ - fixtures/{sample_module}/src/main/java/{sample_package}/SampleApplication.java.erb
107
+ - fixtures/{sample_module}/src/main/res/layout/activity_main.xml
108
+ - fixtures/{sample_module}/src/main/res/mipmap-hdpi/ic_launcher.png
109
+ - fixtures/{sample_module}/src/main/res/mipmap-mdpi/ic_launcher.png
110
+ - fixtures/{sample_module}/src/main/res/mipmap-xhdpi/ic_launcher.png
111
+ - fixtures/{sample_module}/src/main/res/mipmap-xxhdpi/ic_launcher.png
112
+ - fixtures/{sample_module}/src/main/res/mipmap-xxxhdpi/ic_launcher.png
113
+ - fixtures/{sample_module}/src/main/res/values/colors.xml
114
+ - fixtures/{sample_module}/src/main/res/values/dimens.xml
115
+ - fixtures/{sample_module}/src/main/res/values/strings.xml.erb
116
+ - fixtures/{sample_module}/src/main/res/values/styles.xml
72
117
  - lib/robotkit.rb
118
+ - lib/robotkit/cli.rb
73
119
  - lib/robotkit/version.rb
74
120
  - robotkit.gemspec
75
121
  homepage: https://github.com/kazy1991/robotkit