robotkit 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a225cdc8cb5c7126b7ff836c28b4b2791703d68a
4
- data.tar.gz: ae5d0f7c23d4b114bc436296ade95433153d57eb
3
+ metadata.gz: 73a428358fbb5d3b840f5ec0fb5353bfc66c18c8
4
+ data.tar.gz: 2b409b582190fe765f50029cb4e1746cef1d69a7
5
5
  SHA512:
6
- metadata.gz: 372b0b14efe51332e1ea88f73745a2a4885874b13c8ca80ce83f33c05cd88e39021aa6e497c51195724a05919bb5023238b41866bbf5bc64a725f8cae24e7546
7
- data.tar.gz: d01646b28ffa7f6541a74f39b03f1c2d2269e7adb69986adf695b9f90f17a58e66760cc562271e0cd1d58fd0e3ae479f7366ae071079ac065b963696e01b49b9
6
+ metadata.gz: e45b7e08126ca25ff472c40f1e3fd8bfa851a2f1937af2b9e63a186be72427d9ad157bbafc66163548a05168b1c4aa841953567a888810e497095c73edf85491
7
+ data.tar.gz: b65537914fdb1c3d0d6e52cd1e05f13721c0492c77edca1266321d164f807df36aa1583f52a3289043c37d590e166f08d6d15c479bbf71a86864655f57419c7d
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ .idea/
@@ -3,14 +3,17 @@ buildscript {
3
3
  jcenter()
4
4
  }
5
5
  dependencies {
6
- classpath 'com.android.tools.build:gradle:2.3.0'
6
+ classpath 'com.android.tools.build:gradle:2.3.3'
7
+ <%- if library_options.include?('android-maven-gradle-plugin') -%>
7
8
  classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
9
+ <%- end -%>
8
10
  }
9
11
  }
10
12
 
11
13
  allprojects {
12
14
  repositories {
13
15
  jcenter()
16
+ google()
14
17
  }
15
18
  }
16
19
 
@@ -1,6 +1,6 @@
1
- #Mon Dec 28 10:00:20 PST 2015
1
+ #Fri Sep 08 22:04:47 JST 2017
2
2
  distributionBase=GRADLE_USER_HOME
3
3
  distributionPath=wrapper/dists
4
4
  zipStoreBase=GRADLE_USER_HOME
5
5
  zipStorePath=wrapper/dists
6
- distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip
6
+ distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
@@ -1,10 +1,10 @@
1
1
  # SDK versions
2
- compile_sdk_version=25
3
- build_tools_version=25.0.2
4
- min_sdk_version=15
5
- target_sdk_version=25
2
+ compile_sdk_version=26
3
+ build_tools_version=26.0.1
4
+ min_sdk_version=<%= min_sdk %>
5
+ target_sdk_version=<%= target_sdk %>
6
6
  # Library versions
7
- support_lib_version=25.3.1
7
+ support_lib_version=26.0.2
8
8
  # Build options
9
9
  org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
10
10
  org.gradle.parallel=true
data/fixtures/gradlew CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env bash
1
+ #!/usr/bin/env sh
2
2
 
3
3
  ##############################################################################
4
4
  ##
@@ -6,12 +6,30 @@
6
6
  ##
7
7
  ##############################################################################
8
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=""
9
+ # Attempt to set APP_HOME
10
+ # Resolve links: $0 may be a link
11
+ PRG="$0"
12
+ # Need this for relative symlinks.
13
+ while [ -h "$PRG" ] ; do
14
+ ls=`ls -ld "$PRG"`
15
+ link=`expr "$ls" : '.*-> \(.*\)$'`
16
+ if expr "$link" : '/.*' > /dev/null; then
17
+ PRG="$link"
18
+ else
19
+ PRG=`dirname "$PRG"`"/$link"
20
+ fi
21
+ done
22
+ SAVED="`pwd`"
23
+ cd "`dirname \"$PRG\"`/" >/dev/null
24
+ APP_HOME="`pwd -P`"
25
+ cd "$SAVED" >/dev/null
11
26
 
12
27
  APP_NAME="Gradle"
13
28
  APP_BASE_NAME=`basename "$0"`
14
29
 
30
+ # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31
+ DEFAULT_JVM_OPTS=""
32
+
15
33
  # Use the maximum available, or set MAX_FD != -1 to use that value.
16
34
  MAX_FD="maximum"
17
35
 
@@ -30,6 +48,7 @@ die ( ) {
30
48
  cygwin=false
31
49
  msys=false
32
50
  darwin=false
51
+ nonstop=false
33
52
  case "`uname`" in
34
53
  CYGWIN* )
35
54
  cygwin=true
@@ -40,26 +59,11 @@ case "`uname`" in
40
59
  MINGW* )
41
60
  msys=true
42
61
  ;;
62
+ NONSTOP* )
63
+ nonstop=true
64
+ ;;
43
65
  esac
44
66
 
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
67
  CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64
68
 
65
69
  # Determine the Java command to use to start the JVM.
@@ -85,7 +89,7 @@ location of your Java installation."
85
89
  fi
86
90
 
87
91
  # Increase the maximum file descriptors if we can.
88
- if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
92
+ if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
89
93
  MAX_FD_LIMIT=`ulimit -H -n`
90
94
  if [ $? -eq 0 ] ; then
91
95
  if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -150,11 +154,19 @@ if $cygwin ; then
150
154
  esac
151
155
  fi
152
156
 
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=("$@")
157
+ # Escape application args
158
+ save ( ) {
159
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160
+ echo " "
156
161
  }
157
- eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158
- JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
162
+ APP_ARGS=$(save "$@")
163
+
164
+ # Collect all arguments for the java command, following the shell quoting and substitution rules
165
+ eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166
+
167
+ # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168
+ if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169
+ cd "$(dirname "$0")"
170
+ fi
159
171
 
160
- exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
172
+ exec "$JAVACMD" "$@"
data/fixtures/gradlew.bat CHANGED
@@ -8,14 +8,14 @@
8
8
  @rem Set local scope for the variables with windows NT shell
9
9
  if "%OS%"=="Windows_NT" setlocal
10
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
11
  set DIRNAME=%~dp0
15
12
  if "%DIRNAME%" == "" set DIRNAME=.
16
13
  set APP_BASE_NAME=%~n0
17
14
  set APP_HOME=%DIRNAME%
18
15
 
16
+ @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17
+ set DEFAULT_JVM_OPTS=
18
+
19
19
  @rem Find java.exe
20
20
  if defined JAVA_HOME goto findJavaFromJavaHome
21
21
 
@@ -46,10 +46,9 @@ echo location of your Java installation.
46
46
  goto fail
47
47
 
48
48
  :init
49
- @rem Get command-line arguments, handling Windowz variants
49
+ @rem Get command-line arguments, handling Windows variants
50
50
 
51
51
  if not "%OS%" == "Windows_NT" goto win9xME_args
52
- if "%@eval[2+2]" == "4" goto 4NT_args
53
52
 
54
53
  :win9xME_args
55
54
  @rem Slurp the command line arguments.
@@ -60,11 +59,6 @@ set _SKIP=2
60
59
  if "x%~1" == "x" goto execute
61
60
 
62
61
  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
62
 
69
63
  :execute
70
64
  @rem Setup the command line
@@ -1,5 +1,7 @@
1
1
  apply plugin: 'com.android.library'
2
+ <%- if library_options.include?('android-maven-gradle-plugin') -%>
2
3
  apply plugin: 'com.github.dcendents.android-maven'
4
+ <%- end -%>
3
5
 
4
6
  android {
5
7
  compileSdkVersion compile_sdk_version as int
data/lib/robotkit/cli.rb CHANGED
@@ -13,12 +13,11 @@ module Robotkit
13
13
  options[:output_dir] = prompt.ask('What is library name?', default: 'SampleLibrary')
14
14
  options[:package_name] = prompt.ask('What is package name?', default: 'com.android.sample')
15
15
  options[:module_name] = prompt.ask('What is module name?', default: options[:output_dir].downcase)
16
- # options[:min_sdk] = prompt.ask('Type min_sdk version', default: 16)
17
- # options[:target_sdk] = prompt.ask('Type target_sdk version', default: 25)
18
- #
19
- # library_choices = %w(maven-gradle-plugin jack)
20
- # options[:selected_library_options] = prompt.multi_select("Select library module options: ", library_choices)
21
- #
16
+ options[:min_sdk] = prompt.ask('Type min_sdk version', default: 16)
17
+ options[:target_sdk] = prompt.ask('Type target_sdk version', default: 25)
18
+ library_choices = %w(android-maven-gradle-plugin)
19
+ options[:library_options] = prompt.multi_select("Select library module options: ", library_choices)
20
+
22
21
  # sample_choices = %w(jack rxjava1 rxjava2)
23
22
  # options[:selected_sample_options] = prompt.multi_select("Select sample module options: ", sample_choices)
24
23
  Robotkit.exec(options)
@@ -34,6 +33,9 @@ module Robotkit
34
33
  sample_package_name = "#{params[:package_name]}.sample"
35
34
  library_module = params[:module_name] || "library"
36
35
  sample_module = params[:sample_module] || "sample"
36
+ min_sdk = params[:min_sdk]
37
+ target_sdk = params[:target_sdk]
38
+ library_options = params[:library_options]
37
39
 
38
40
  # copy from fixtues dir to output dir
39
41
  FileUtils.mkdir(output_dir)
@@ -58,7 +60,7 @@ module Robotkit
58
60
  sample_files = %w(MainActivity SampleApplication)
59
61
  sample_files.each do |file_name|
60
62
  File.open("#{sample_package_src}/#{file_name}.java", "w") do |file|
61
- result = ERB.new(File.open("#{output_dir}/#{sample_module}/src/main/java/{sample_package}/#{file_name}.java.erb").read).result(binding)
63
+ result = ERB.new(File.open("#{output_dir}/#{sample_module}/src/main/java/{sample_package}/#{file_name}.java.erb").read, nil, '-').result(binding)
62
64
  file.write(result)
63
65
  end
64
66
  end
@@ -67,7 +69,7 @@ module Robotkit
67
69
 
68
70
  #eval erb
69
71
  Dir.glob("#{output_dir}/**/*").select{|it| it.end_with?("erb")}.each do |path|
70
- result = ERB.new(File.open(path).read).result(binding)
72
+ result = ERB.new(File.open(path).read, nil, '-').result(binding)
71
73
  File.open(path.sub(".erb", ""), "w") do |file|
72
74
  file.write(result)
73
75
  end
@@ -1,3 +1,3 @@
1
1
  module Robotkit
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: robotkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kazuki-yoshida
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-09 00:00:00.000000000 Z
11
+ date: 2017-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty
@@ -100,15 +100,15 @@ files:
100
100
  - bin/setup
101
101
  - exe/robotkit
102
102
  - fixtures/.gitignore
103
- - fixtures/build.gradle
104
- - fixtures/gradle.properties
103
+ - fixtures/build.gradle.erb
104
+ - fixtures/gradle.properties.erb
105
105
  - fixtures/gradle/wrapper/gradle-wrapper.jar
106
106
  - fixtures/gradle/wrapper/gradle-wrapper.properties
107
107
  - fixtures/gradlew
108
108
  - fixtures/gradlew.bat
109
109
  - fixtures/settings.gradle.erb
110
110
  - fixtures/{library_module}/.gitignore
111
- - fixtures/{library_module}/build.gradle
111
+ - fixtures/{library_module}/build.gradle.erb
112
112
  - fixtures/{library_module}/proguard-rules.pro
113
113
  - fixtures/{library_module}/src/main/AndroidManifest.xml.erb
114
114
  - fixtures/{library_module}/src/main/java/{library_package}/.gitkeep
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  version: '0'
154
154
  requirements: []
155
155
  rubyforge_project:
156
- rubygems_version: 2.6.8
156
+ rubygems_version: 2.6.11
157
157
  signing_key:
158
158
  specification_version: 4
159
159
  summary: Android library template generator