Skip to content

Instantly share code, notes, and snippets.

@Piasy
Created March 10, 2016 15:05
Show Gist options
  • Save Piasy/efc83b11e82fd0e5a33a to your computer and use it in GitHub Desktop.
Save Piasy/efc83b11e82fd0e5a33a to your computer and use it in GitHub Desktop.

Revisions

  1. Piasy created this gist Mar 10, 2016.
    4 changes: 4 additions & 0 deletions .gitignore
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    # buck & OkBuck
    /buck-out/
    /.buckd/
    /.okbuck/
    12 changes: 12 additions & 0 deletions AndroidManifest.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.github.piasy.template"
    android:versionCode="1"
    android:versionName="1.0.0"
    >

    <uses-sdk
    android:targetSdkVersion="23"
    android:minSdkVersion="15"
    />
    ...
    19 changes: 19 additions & 0 deletions build1.gradle
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    ...
    buildscript {
    ...
    dependencies {
    ...
    classpath "com.github.piasy:okbuck-gradle-plugin:0.2.6"
    }
    }
    ...
    apply plugin: 'com.github.piasy.okbuck-gradle-plugin'
    okbuck {
    target "android-23"
    overwrite true
    resPackages = [
    'common-android': 'com.github.piasy.common.android',
    'model': 'com.github.piasy.model',
    'presentation': 'com.github.piasy.template',
    ]
    }
    12 changes: 12 additions & 0 deletions build2.gradle
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    ...
    apply plugin: 'com.github.piasy.okbuck-gradle-plugin'
    okbuck {
    target "android-23"
    overwrite true
    signConfigName "develop"
    resPackages = [
    'common-android': 'com.github.piasy.common.android',
    'model': 'com.github.piasy.model',
    'presentation': 'com.github.piasy.template',
    ]
    }
    16 changes: 16 additions & 0 deletions build3.gradle
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    ...
    android {
    compileSdkVersion rootProject.ext.androidCompileSdkVersion
    buildToolsVersion rootProject.ext.androidBuildToolsVersion

    defaultConfig {
    // 删除了原来对targetSdkVersion, minSdkVersion的定义
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    buildConfigField "boolean", "REPORT_CRASH", "true"
    }
    ...
    productFlavors.whenObjectAdded { flavor ->
    def flavorData = rootProject.ext[flavor.name]
    // 删除了原来对applicationId, versionCode, versionName的定义
    }
    }
    6 changes: 6 additions & 0 deletions build4.gradle
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    /*developCompile presentationDependencies.xLogAndroid
    productCompile presentationDependencies.xLogAndroidIdle*/
    compile presentationDependencies.xLogAndroid
    /*developCompile presentationDependencies.leakCanary
    productCompile presentationDependencies.leakCanaryIdle*/
    compile presentationDependencies.leakCanary
    5 changes: 5 additions & 0 deletions error1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    * What went wrong:
    Execution failed for task ':okbuck'.
    > Can not figure out sign config, please make sure you have only
    one sign config in your build.gradle, or set signConfigName in
    okbuck dsl.
    13 changes: 13 additions & 0 deletions error2.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    /Users/piasy/src/AndroidTDDBootStrap/buck-out/annotation/
    common-android/__src_gen__/com/github/piasy/common/
    android/utils/AndroidUtilsModule_ProvideRxErrorPro
    cessorFactory.java:9: error: 找不到符号
    @Generated("dagger.internal.codegen.ComponentProcessor")
    ^
    符号: Generated
    /Users/piasy/src/AndroidTDDBootStrap/buck-out/annotation/
    common-android/__src_gen__/com/github/piasy/common/
    android/utils/AndroidUtilsModule_ProvideMiUIUtilFa
    ctory.java:5: error: 程序包javax.annotation不存在
    import javax.annotation.Generated;
    ^
    5 changes: 5 additions & 0 deletions error3.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    /Users/piasy/src/AndroidTDDBootStrap/presentation/src/
    main/java/com/github/piasy/template/features/splash/
    GithubSearchFragment.java:-1: error: 不兼容的类型:
    java.util.List<java.lang.Object>无法转换为
    java.util.List<com.github.piasy.model.entities.GithubUser>
    1 change: 1 addition & 0 deletions error4.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    showSearchUserResult(Collections.emptyList());
    1 change: 1 addition & 0 deletions error5.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    showSearchUserResult(Collections.<GithubUser>emptyList());
    2 changes: 2 additions & 0 deletions error6.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up,
    install an Android build tool and ask a team member to invite you to this app's organization.