Skip to content

Commit

Permalink
生成的sample和skin自动拷贝至项目apk目录下
Browse files Browse the repository at this point in the history
  • Loading branch information
fengjundev committed Dec 2, 2015
1 parent 0a3be0b commit 6338885
Show file tree
Hide file tree
Showing 34 changed files with 2,292 additions and 459 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/libraries/appcompat_v7_23_1_1.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions .idea/libraries/support_v4_23_1_1.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2,360 changes: 1,907 additions & 453 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Expand Up @@ -34,7 +34,7 @@ public void dynamicAddView(View view, List<DynamicAttr> pDAttrs) {
mIDynamicNewView.dynamicAddView(view, pDAttrs);
}
}

public LayoutInflater getLayoutInflater(Bundle savedInstanceState) {
LayoutInflater result = getActivity().getLayoutInflater();
return result;
Expand Down
50 changes: 50 additions & 0 deletions android-skin-loader-sample/build.gradle
Expand Up @@ -24,3 +24,53 @@ dependencies {
testCompile 'junit:junit:4.12'
compile project(':android-skin-loader-lib')
}

final def TARGET_SKIN_DIR = '../apk/'
final def SAMPLE_NAME = 'Sample.apk'
assembleRelease.doLast {
println("=====================assembleRelease.doLast.begin.=========================")

def dir = new File(TARGET_SKIN_DIR)
if (!dir.exists()) {
dir.mkdirs()
}

def f = new File(TARGET_SKIN_DIR + SAMPLE_NAME)
if (f.exists()) {
f.delete()
}

copy {
from('build/outputs/apk')
into(TARGET_SKIN_DIR)
include '*.apk'
exclude '**/*-unaligned.apk'
rename ('android-skin-loader-sample-release.apk', SAMPLE_NAME)
}

println("=====================assembleRelease.doLast success.=========================")
}

assembleDebug.doLast {
println("=====================assembleDebug.doLast.begin.=========================")

def dir = new File(TARGET_SKIN_DIR)
if (!dir.exists()) {
dir.mkdirs()
}

def f = new File(TARGET_SKIN_DIR + SAMPLE_NAME)
if (f.exists()) {
f.delete()
}

copy {
from('build/outputs/apk')
into(TARGET_SKIN_DIR)
include '*.apk'
exclude '**/*-unaligned.apk'
rename ('android-skin-loader-sample-debug.apk', SAMPLE_NAME)
}

println("=====================assembleDebug.doLast success.=========================")
}
1 change: 1 addition & 0 deletions android-skin-loader-skin/.gitignore
@@ -0,0 +1 @@
/build
89 changes: 89 additions & 0 deletions android-skin-loader-skin/android-skin-loader-skin.iml
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":android-skin-loader-skin" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="Android-Skin-Loader" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":android-skin-loader-skin" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
<afterSyncTasks>
<task>generateDebugAndroidTestSources</task>
<task>generateDebugSources</task>
</afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-v4-23.1.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.1.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.1.1" level="project" />
</component>
</module>
84 changes: 84 additions & 0 deletions android-skin-loader-skin/build.gradle
@@ -0,0 +1,84 @@
apply plugin: 'com.android.application'

def skinName = "BlackFantacy.skin"

android {
signingConfigs {
config {
keyAlias 'fengjun'
keyPassword 'fengjun'
storeFile file('keystore.key')
storePassword 'fengjun'
}
}
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.android_skin_laoder_skin"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
}

final def TARGET_SKIN_DIR = '../apk/'
assembleRelease.doLast {
println("=====================assembleRelease.doLast.begin.=========================")

def dir = new File(TARGET_SKIN_DIR)
if (!dir.exists()) {
dir.mkdirs()
}

def f = new File(TARGET_SKIN_DIR + skinName)
if (f.exists()) {
f.delete()
}

copy {
from('build/outputs/apk')
into(TARGET_SKIN_DIR)
include '*.apk'
exclude '**/*-unaligned.apk'
rename ('android-skin-loader-skin-release.apk', skinName)
}

println("=====================assembleRelease.doLast success.=========================")
}

assembleDebug.doLast {
println("=====================assembleDebug.doLast.begin.=========================")

def dir = new File(TARGET_SKIN_DIR)
if (!dir.exists()) {
dir.mkdirs()
}

def f = new File(TARGET_SKIN_DIR + skinName)
if (f.exists()) {
f.delete()
}

copy {
from('build/outputs/apk')
into(TARGET_SKIN_DIR)
include '*.apk'
exclude '**/*-unaligned.apk'
rename ('android-skin-loader-skin-debug.apk', skinName)
}

println("=====================assembleDebug.doLast success.=========================")
}
17 changes: 17 additions & 0 deletions android-skin-loader-skin/proguard-rules.pro
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/fengjun/Developement/Environment/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 *;
#}
Binary file not shown.
@@ -0,0 +1,13 @@
package com.example.android_skin_laoder_skin;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
13 changes: 13 additions & 0 deletions android-skin-loader-skin/src/main/AndroidManifest.xml
@@ -0,0 +1,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android_skin_laoder_skin">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">

</application>

</manifest>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:color="@color/color_new_item_title_pressed" android:state_pressed="true"/>
<item android:color="@color/color_new_item_title"/>

</selector>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,10 @@
<?xml version = "1.0" encoding = "utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:drawable="@drawable/color_news_item_pressed" android:state_pressed="true"/>
<item android:drawable="@drawable/color_news_item_pressed" android:state_focused="true"/>
<item android:drawable="@drawable/color_news_item_normal" android:state_focused="false"/>
<item android:drawable="@drawable/color_news_item_normal" android:state_pressed="false"/>
<item android:drawable="@drawable/color_news_item_normal"/>

</selector>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:color="@color/color_new_item_title_pressed" android:state_pressed="true"/>
<item android:color="@color/color_new_item_title"/>

</selector>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:drawable="@drawable/skin_setting_press" android:state_pressed="true"/>
<item android:drawable="@drawable/skin_setting_normal"/>

</selector>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6338885

Please sign in to comment.