Commit 89f950d6 by kevinhong

initial commit

parents
.idea/
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.young.tools.experiment"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
signingConfigs {
sign {
keyAlias 'androiddebugkey'
keyPassword 'android'
storeFile file('../debug_ok.keystore')
storePassword 'android'
}
}
buildTypes {
debug {
signingConfig signingConfigs.sign
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.sign
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'
testCompile 'junit:junit:4.12'
compile 'com.jakewharton:butterknife:8.7.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
}
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Volumes/DATA/develop/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
package com.young.tools.experiment;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.young.tools.experiment", appContext.getPackageName());
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.young.tools.experiment">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".screentest.ScreenTestActivity"></activity>
</application>
</manifest>
\ No newline at end of file
package com.young.tools.experiment;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
import com.young.tools.experiment.screentest.ScreenTestActivity;
public class MainActivity extends AppCompatActivity {
private ListView listView;
private ArrayAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
adapter = new ArrayAdapter(this,
android.R.layout.simple_list_item_1);
adapter.add("屏幕测试");
listView = (ListView) findViewById(R.id.listView);
listView.setAdapter(adapter);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView arg0, View arg1, int arg2,
long arg3) {
Toast.makeText(MainActivity.this,String.valueOf(arg3),Toast.LENGTH_SHORT).show();;
Intent intent = null;
switch ((int)arg3) {
case 0:
intent = new Intent(MainActivity.this, ScreenTestActivity.class);
break;
}
startActivity(intent);
}
});
}
}
package com.young.tools.experiment.screentest;
import android.content.Context;
import android.graphics.Point;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Display;
import android.view.WindowManager;
import android.widget.TextView;
import com.young.tools.experiment.R;
import com.young.tools.experiment.util.SystemUtil;
import com.young.tools.experiment.util.ViewUtil;
import butterknife.BindView;
import butterknife.ButterKnife;
public class ScreenTestActivity extends AppCompatActivity {
@BindView(R.id.tvTip)
TextView tvTip;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_screen_test);
ButterKnife.bind(this);
Display display = getWindowManager().getDefaultDisplay();
int width, height;
if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB_MR2) {
width = display.getWidth();
height = display.getHeight();
} else {
Point size = new Point();
display.getSize(size);
width = size.x;
height = size.y;
}
String tp = "Screen width : " + width + " px, " + ViewUtil.pxToDp(this,width) + " dp\n" +
"height: " + height + " px, " + ViewUtil.pxToDp(this,height) + " dp\n";
tp = tp + "Brand: " + SystemUtil.getDeviceBrand() + " " + SystemUtil.getSystemModel() + " " + SystemUtil.getSystemVersion() ;
tvTip.setText(tp);
}
}
package com.young.tools.experiment.util;
/**
* Created by MACpro1 on 2017/8/26.
*/
import android.app.Activity;
import android.content.Context;
import android.telephony.TelephonyManager;
import java.util.Locale;
/**
* 系统工具类
* Created by zhuwentao on 2016-07-18.
*/
public class SystemUtil {
/**
* 获取当前手机系统语言。
*
* @return 返回当前系统语言。例如:当前设置的是“中文-中国”,则返回“zh-CN”
*/
public static String getSystemLanguage() {
return Locale.getDefault().getLanguage();
}
/**
* 获取当前系统上的语言列表(Locale列表)
*
* @return 语言列表
*/
public static Locale[] getSystemLanguageList() {
return Locale.getAvailableLocales();
}
/**
* 获取当前手机系统版本号
*
* @return 系统版本号
*/
public static String getSystemVersion() {
return android.os.Build.VERSION.RELEASE;
}
/**
* 获取手机型号
*
* @return 手机型号
*/
public static String getSystemModel() {
return android.os.Build.MODEL;
}
/**
* 获取手机厂商
*
* @return 手机厂商
*/
public static String getDeviceBrand() {
return android.os.Build.BRAND;
}
/**
* 获取手机IMEI(需要“android.permission.READ_PHONE_STATE”权限)
*
* @return 手机IMEI
*/
public static String getIMEI(Context ctx) {
TelephonyManager tm = (TelephonyManager) ctx.getSystemService(Activity.TELEPHONY_SERVICE);
if (tm != null) {
return tm.getDeviceId();
}
return null;
}
}
\ No newline at end of file
package com.young.tools.experiment.util;
import android.content.Context;
/**
* Created by MACpro1 on 2017/8/26.
*/
public class ViewUtil {
public static float pxToDp(Context context, float px) {
if (context == null) {
return -1;
}
return px / context.getResources().getDisplayMetrics().density;
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:background="@color/white"
android:layout_height="match_parent">
<ListView android:id="@+id/listView"
android:layout_width="match_parent" android:layout_height="match_parent"></ListView>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.young.tools.experiment.screentest.ScreenTestActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
<TextView
android:layout_marginLeft="15dp"
android:layout_marginTop="15dp"
android:id="@+id/tvTip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:background="@color/white"
android:textColor="@color/black"
android:text=""/>
<TextView
android:layout_marginTop="15dp"
android:layout_width="320dp"
android:layout_height="140dp"
android:textSize="24sp"
android:gravity="center"
android:background="@color/orange"
android:textColor="@color/white"
android:text="Width: 320dp\nHeight:140dp\nTextSize:24sp"/>
<TextView
android:layout_marginTop="15dp"
android:layout_width="360dp"
android:layout_height="140dp"
android:textSize="24sp"
android:gravity="center"
android:background="@color/orange"
android:textColor="@color/white"
android:text="Width: 360dp\nHeight:140dp\nTextSize:24sp"/>
<TextView
android:layout_marginTop="15dp"
android:layout_width="320px"
android:layout_height="140px"
android:textSize="24px"
android:gravity="center"
android:background="@color/orange"
android:textColor="@color/white"
android:text="Width: 320px\nHeight:140px\nTextSize:24px"/>
<TextView
android:layout_marginTop="15px"
android:layout_width="360px"
android:layout_height="140px"
android:textSize="24px"
android:gravity="center"
android:background="@color/orange"
android:textColor="@color/white"
android:text="Width: 360px\nHeight:140px\nTextSize:24px"/>
</LinearLayout>
</ScrollView>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="default_progress_bar_color">#ffff7522</color>
<color name="contents_text">#ff000000</color>
<color name="encode_view">#ffffffff</color>
<color name="help_button_view">#ffcccccc</color>
<color name="help_view">#ff404040</color>
<color name="possible_result_points">#c0ffff00</color>
<color name="result_image_border">#ffffffff</color>
<color name="result_minor_text">#ffc0c0c0</color>
<color name="result_points">#c000ff00</color>
<color name="result_text">#ffffffff</color>
<color name="result_view">#b0000000</color>
<color name="sbc_header_text">#ff808080</color>
<color name="sbc_header_view">#ffffffff</color>
<color name="sbc_list_item">#fffff0e0</color>
<color name="sbc_layout_view">#ffffffff</color>
<color name="sbc_page_number_text">#ff000000</color>
<color name="sbc_snippet_text">#ff4b4b4b</color>
<color name="share_text">#ff000000</color>
<color name="share_view">#ffffffff</color>
<color name="status_view">#50000000</color>
<color name="status_text">#ffffffff</color>
<color name="viewfinder_frame">#ff8D8D8D</color>
<color name="viewfinder_laser">#ffCAFF70</color>
<color name="viewfinder_mask">#60000000</color>
<color name="list_bg_n">#00000000</color>
<color name="list_bg_p">#d4d4d4</color>
<color name="footer_bg_p">#FFDDDDDD</color>
<color name="avatar_selected">#7f000000</color>
<color name="white">#ffffffff</color>
<color name="checked">#ffd9d9d9</color>
<color name="liveprice_bg">#ffd9d9d9</color>
<color name="black">#ff000000</color>
<color name="red">#ffff0000</color>
<color name="gray">#ff808080</color>
<color name="orange">#ffde6720</color>
<color name="latestoffer_tips_bg_p">#8a3706</color>
<color name="topic_t_bg_n">#ffe2e7eb</color>
<color name="topic_t_bg_p">#ffd0d6dc</color>
<color name="topic_comment_bg_n">#ffefefef</color>
<color name="topic_comment_bg_p">#ffdddddd</color>
<color name="message_remind_default">#ffffc000</color>
<color name="message_remind_pressed">#ffd5a30d</color>
<color name="person_myinfo_item_bg_p">#d4d4d4</color>
<color name="poi_item_p">#d4d4d4</color>
<color name="poi_item">#FFFFFF</color>
<color name="club_main_recomment_bg_n">#e2e7eb</color>
<color name="club_main_recomment_bg_p">#d0d6dc</color>
<color name="club_main_comment_bg_n">#e3e3e3</color>
<color name="club_main_comment_bg_p">#d3d3d3</color>
<color name="transparent">#00000000</color>
<color name="gray_text_color">#333333</color>
<color name="last_word_count_color">#999999</color>
<color name="nick_color">#004d99</color>
<color name="light_gray_text_color">#888888</color>
<color name="layout_default_color">#f2f2f2</color>
<color name="default_image_bg_color">#ffffff</color>
<color name="nodata_text_color">#999999</color>
<color name="default_item_line_color">#e0e0e0</color>
<color name="dclubUpdatesMsg_word_color">#e49d21</color>
<color name="dclubUpdatesMsg_bg_color">#ffffffff</color>
<color name="table_title_bg_color">#ffeeeeee</color>
<color name="salerinfo_bg_color">#ffededed</color>
<color name="sideBar_signText_bg_color">#90000000</color>
<color name="main_menu_bg_color">#282828</color>
<color name="main_menu_item_bg_color">#323232</color>
<color name="main_menu_line1_color">#383838</color>
<color name="main_menu_line2_color">#2f2f2f</color>
<color name="main_menu_line3_color">#202020</color>
<color name="main_menu_text_color">#666666</color>
<color name="main_menu_text1_color">#bdbdbd</color>
<color name="subscription_item_rim_color">#999999</color>
<color name="subscription_item_bg_color_p">#b2b2b2</color>
<color name="actionbar_bg_color">#1e1d1f</color>
<color name="main_menu_city_color">#777777</color>
<color name="gray_color1">#ff333333</color>
<color name="gray_color2">#ff666666</color>
<color name="gray_color3">#ff999999</color>
<color name="gray_color4">#ffededed</color>
<color name="gray_color5">#ffcccccc</color>
<color name="gray_color6">#fff5f5f5</color>
<color name="gray_color7">#ffc1c1c1</color>
<color name="gray_color8">#ffe6e6e6</color>
<color name="gray_color9">#fffafafa</color>
<color name="orange_color">#ffff7522</color>
<color name="orange_color_press">#ffe5691f</color>
<color name="red_color">#ffcf3b1d</color>
<color name="red_color1">#ffda5b04</color>
<color name="red_color2">#ffff7522</color>
<color name="yellow_color">#ffffee99</color>
<color name="yellow_color1">#ffffdd00</color>
<color name="blue_color">#ff2196f3</color>
<color name="blue_color_p">#ff1b75bf</color>
<color name="green_color">#ff51b334</color>
<color name="green_color_p">#ff49a12f</color>
<color name="green_color1">#ff00ae73</color>
<color name="green_color1_p">#ff008b5c</color>
<color name="avatar_border_inside_color">#ffffffff</color>
<color name="avatar_border_outside_color">#00000000</color>
<color name="white_pressed_bg">#ffe5e5e5</color>
<color name="white_text_unable">#7fffffff</color>
<color name="gray_pressed_bg">#ffe4e4e4</color>
<color name="shadow_start">#80000000</color>
<color name="shadow_end">#00000000</color>
<color name="ask_price_unable_color">#b8b8b8</color>
<color name="home_bargain_color_n">#ffff3c3c</color>
<color name="home_bargain_color_p">#ffcc3030</color>
<color name="pink_color">#fffaece3</color>
<color name="white_pressed_color2">#fffff4ee</color>
<color name="dialog_top_yellow_gradient_startcolor_bg">#ffffdf00</color>
<color name="dialog_top_yellow_gradient_endcolor_bg">#ffffbe4e</color>
<drawable name="white_pressed_bg">#ffe5e5e5</drawable>
<drawable name="translucent_background">#00000000</drawable>
<drawable name="translucent_delete">#00000000</drawable>
<drawable name="carseries_list_divider">#dcdcdc</drawable>
<drawable name="list_selected_holo_light">#b4dcea</drawable>
<drawable name="share_item_bg">#f5f5f5</drawable>
<drawable name="subscription_addcar_bg">#ebebeb</drawable>
<drawable name="inquiry_city_bg">#201F21</drawable>
<drawable name="panelActionBar_bg">#ffffffff</drawable>
<drawable name="divider">#ffcccccc</drawable>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="main_bottom_text_normal">#ff847d7b</color>
<color name="main_botton_text_select">#ff333333</color>
<color name="main_bottom_bg">#11000000</color>
<color name="essence_tab_bg">@color/white</color>
<color name="essence_tab_text_color_normal">@color/gray</color>
<color name="essence_tab_text_color_press">@color/orange</color>
<color name="trans_black">#7f000000</color>
<color name="colB5B5B5">#B5B5B5</color>
<color name="colFFF2EF">#FFF2EF</color>
<color name="colF4F4F4">#F4F4F4</color>
<color name="col666666">#666666</color>
<color name="colorPrimaryDarkTrans">#CCf57257</color>
</resources>
\ No newline at end of file
<resources>
<string name="app_name">Experiment</string>
</resources>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
package com.young.tools.experiment;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
\ No newline at end of file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Sat Aug 26 07:58:25 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
include ':app'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment