Skip to content

Commit

Permalink
Merge pull request #78 from AlanCheen/feature/1.6.1
Browse files Browse the repository at this point in the history
Feature/1.6.1
  • Loading branch information
AlanCheen authored Sep 9, 2020
2 parents b23c979 + 2ba8a6a commit 3ee287f
Show file tree
Hide file tree
Showing 35 changed files with 690 additions and 28 deletions.
54 changes: 44 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

apply plugin: 'me.yifeiyuan.flap.plugin'

buildscript {
repositories {
google()
jcenter()

maven {
url = "$rootProject.projectDir/repos"
}
}

dependencies {
classpath 'me.yifeiyuan.flap:plugin:1.0.0.1'
}
}

android {
compileSdkVersion 29
Expand All @@ -17,14 +35,26 @@ android {
arguments = [autoRegister:'true']
}
}

multiDexEnabled true
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}

dataBinding {
enabled = true
}
Expand All @@ -33,21 +63,25 @@ android {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

implementation 'androidx.recyclerview:recyclerview:1.1.0'

implementation project(':flap')
implementation project(':flap-annotations')
annotationProcessor project(':flap-compiler')
// implementation project(':flap')
// implementation project(':flap-annotations')
// annotationProcessor project(':flap-compiler')

// implementation 'me.yifeiyuan.flap:flap-annotations:1.5.1'
// implementation 'me.yifeiyuan.flap:flap:1.5.2'
// annotationProcessor 'me.yifeiyuan.flap:flap-compiler:1.5.1'
implementation 'me.yifeiyuan.flap:flap-annotations:1.6.1'
implementation 'me.yifeiyuan.flap:flap:1.6.1'
kapt 'me.yifeiyuan.flap:flap-compiler:1.6.1'

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

def multidex_version = "2.0.1"
implementation "androidx.multidex:multidex:$multidex_version"

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
// Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("me.yifeiyuan.flapdev", appContext.getPackageName());
// assertEquals("me.yifeiyuan.flapdev", appContext.getPackageName());
}
}
36 changes: 36 additions & 0 deletions app/src/main/java/me/yifeiyuan/flapdev/AsmTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package me.yifeiyuan.flapdev;

import me.yifeiyuan.flap.Flap;
import me.yifeiyuan.flap.apt.proxies.SimpleImageComponentProxy;
import me.yifeiyuan.flap.apt.proxies.SimpleTextComponentProxy;

/**
* Created by 程序亦非猿 on 2020/9/8.
*
* todo proxy 类的名字是 me/xxx/xxxProxy
*
* L1
* LINENUMBER 16 L1
* ALOAD 2
* NEW me/yifeiyuan/flap/apt/proxies/SimpleTextComponentProxy
* DUP
* INVOKESPECIAL me/yifeiyuan/flap/apt/proxies/SimpleTextComponentProxy.<init> ()V
* INVOKEVIRTUAL me/yifeiyuan/flap/Flap.register (Lme/yifeiyuan/flap/internal/ComponentProxy;)Lme/yifeiyuan/flap/ComponentRegistry;
* POP
* L2
* LINENUMBER 18 L2
* ALOAD 2
* NEW me/yifeiyuan/flap/apt/proxies/SimpleImageComponentProxy
* DUP
* INVOKESPECIAL me/yifeiyuan/flap/apt/proxies/SimpleImageComponentProxy.<init> ()V
* INVOKEVIRTUAL me/yifeiyuan/flap/Flap.register (Lme/yifeiyuan/flap/internal/ComponentProxy;)Lme/yifeiyuan/flap/ComponentRegistry;
* POP
*
*/
class AsmTest {

private void foo(Flap flap){
flap.register(new SimpleTextComponentProxy());
flap.register(new SimpleImageComponentProxy());
}
}
7 changes: 5 additions & 2 deletions app/src/main/java/me/yifeiyuan/flapdev/FlapApplication.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
package me.yifeiyuan.flapdev;

import android.app.Application;
import android.content.Context;
import android.util.Log;

import androidx.multidex.MultiDex;
import androidx.multidex.MultiDexApplication;

import me.yifeiyuan.flap.Flap;
import me.yifeiyuan.flapdev.components.customviewtype.CustomViewTypeComponent;

/**
* Flap
* Created by 程序亦非猿 on 2018/12/13.
*/
public class FlapApplication extends Application {
public class FlapApplication extends MultiDexApplication {

@Override
public void onCreate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* Created by 程序亦非猿 on 2018/12/4.
*/
@Proxy(layoutId = R.layout.flap_item_simple_text, autoRegister = true)
@Proxy(layoutId = R.layout.flap_item_simple_text, autoRegister = false)
public class SimpleTextComponent extends Component<SimpleTextModel> {

private static final String TAG = "SimpleTextItem";
Expand Down
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ buildscript {
repositories {
google()
jcenter()

maven {
url = "$rootProject.projectDir/repos"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
Expand All @@ -16,6 +20,7 @@ buildscript {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

}
}

Expand Down
2 changes: 1 addition & 1 deletion flap-annotations/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ publish {
userOrg = 'alancheen'
groupId = 'me.yifeiyuan.flap'
artifactId = 'flap-annotations'
publishVersion = '1.5.1'
publishVersion = '1.6.1'
desc = 'flap annotations'
website = 'https://github.com/AlanCheen/Flap'
}
2 changes: 1 addition & 1 deletion flap-compiler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ publish {
userOrg = 'alancheen'
groupId = 'me.yifeiyuan.flap'
artifactId = 'flap-compiler'
publishVersion = '1.5.2'
publishVersion = '1.6.1'
desc = 'flap annotations'
website = 'https://github.com/AlanCheen/Flap'
}
1 change: 1 addition & 0 deletions flap-gradle-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
48 changes: 48 additions & 0 deletions flap-gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apply plugin: 'java-library'
apply plugin: 'maven-publish'

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation gradleApi()
implementation localGroovy()
implementation 'com.android.tools.build:gradle:3.2.1' //transform api 需要

implementation 'org.ow2.asm:asm-all:5.2'
}

sourceCompatibility = "1.8"
targetCompatibility = "1.8"

repositories {
mavenCentral()
}

publishing {

publications {

mavenJava(MavenPublication) {
artifactId = 'plugin'
groupId = 'me.yifeiyuan.flap'
from components.java
version = '1.0.0.1'
}
}

repositories {
maven {
url = "$rootProject.projectDir/repos"
}
}
}

apply plugin: 'com.novoda.bintray-release'

publish {
userOrg = 'alancheen'
groupId = 'me.yifeiyuan.flap'
artifactId = 'flap-plugin'
publishVersion = '1.0.0'
desc = 'flap plugin'
website = 'https://github.com/AlanCheen/Flap'
}
Loading

0 comments on commit 3ee287f

Please sign in to comment.