diff --git a/app/build.gradle b/app/build.gradle index 263f0e3d..64431d6c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,27 +1,31 @@ -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' -apply plugin: 'kotlin-kapt' +//apply plugin: 'kotlin-android-extensions' +//apply plugin: 'kotlin-kapt' -//apply plugin: 'me.yifeiyuan.flap.plugin' - -buildscript { - repositories { - - maven { - url = "$rootProject.projectDir/repos" - } +plugins { + id 'com.android.application' + id 'kotlin-android' + id 'kotlin-kapt' +} - google() - jcenter() - } +//apply plugin: 'me.yifeiyuan.flap.plugin' - dependencies { - //添加插件 -// classpath files("../flap-gradle-plugin/build/generated/libs/flap-gradle-plugin.jar") -// classpath "me.yifeiyuan.flap:plugin:1.1.0-test" - } -} +//buildscript { +// repositories { +// +// maven { +// url = "$rootProject.projectDir/repos" +// } +// +// google() +// jcenter() +// } +// +// dependencies { +// //添加插件 +//// classpath files("../flap-gradle-plugin/build/generated/libs/flap-gradle-plugin.jar") +//// classpath "me.yifeiyuan.flap:plugin:1.1.0-test" +// } +//} android { compileSdkVersion 29 @@ -97,19 +101,16 @@ dependencies { implementation project(':ktmodule') implementation project(':flap') + implementation project(':flap-animation') implementation project(':flap-dsl-viewbinding') implementation project(':flap-dsl-databinding') implementation project(':flap-annotations') // implementation project(':flap-gradle-plugin') kapt project(':flap-compiler') -// implementation 'me.yifeiyuan.flap:flap-annotations:2.0.0' -// implementation 'me.yifeiyuan.flap:flap:2.0.0' -// kapt 'me.yifeiyuan.flap:flap-compiler:2.0.0' - implementation 'jp.wasabeef:recyclerview-animators:4.0.2' // implementation 'com.google.code.gson:gson:2.9.1' implementation 'com.github.bumptech.glide:glide:4.13.2' - annotationProcessor 'com.github.bumptech.glide:compiler:4.13.2' + kapt 'com.github.bumptech.glide:compiler:4.13.2' } diff --git a/app/src/main/java/me/yifeiyuan/flapdev/components/Banner.kt b/app/src/main/java/me/yifeiyuan/flapdev/components/Banner.kt index 643ef0f5..05be941b 100644 --- a/app/src/main/java/me/yifeiyuan/flapdev/components/Banner.kt +++ b/app/src/main/java/me/yifeiyuan/flapdev/components/Banner.kt @@ -1,15 +1,12 @@ package me.yifeiyuan.flapdev.components -import android.util.Log import android.widget.ImageView import androidx.viewpager2.widget.ViewPager2 import com.bumptech.glide.Glide -import kotlinx.android.synthetic.main.fragment_base_case.view.* import me.yifeiyuan.flap.FlapAdapter import me.yifeiyuan.flap.dsl.adapterDelegate import me.yifeiyuan.flapdev.FlapApplication.Companion.toast import me.yifeiyuan.flapdev.R -import me.yifeiyuan.flapdev.enforceSingleScrollDirection /** * Created by 程序亦非猿 on 2022/9/11. diff --git a/app/src/main/java/me/yifeiyuan/flapdev/testcases/ViewPager2Testcase.kt b/app/src/main/java/me/yifeiyuan/flapdev/testcases/ViewPager2Testcase.kt index 916ec833..73a453af 100644 --- a/app/src/main/java/me/yifeiyuan/flapdev/testcases/ViewPager2Testcase.kt +++ b/app/src/main/java/me/yifeiyuan/flapdev/testcases/ViewPager2Testcase.kt @@ -3,17 +3,13 @@ package me.yifeiyuan.flapdev.testcases import android.os.Bundle import android.view.* import android.widget.Toast -import androidx.core.view.get import androidx.fragment.app.Fragment -import androidx.recyclerview.widget.RecyclerView import androidx.viewpager2.widget.ViewPager2 -import kotlinx.android.synthetic.main.fragment_base_case.view.* import me.yifeiyuan.flap.FlapAdapter import me.yifeiyuan.flap.ext.doOnCreateViewHolderEnd import me.yifeiyuan.flapdev.R import me.yifeiyuan.flapdev.Scrollable import me.yifeiyuan.flapdev.components.SimpleTextModel -import me.yifeiyuan.flapdev.enforceSingleScrollDirection import java.util.* /** diff --git a/build.gradle b/build.gradle index 5c7e9835..e3716561 100644 --- a/build.gradle +++ b/build.gradle @@ -5,11 +5,11 @@ buildscript { repositories { google() - jcenter() - - maven { - url = "$rootProject.projectDir/repos" - } + mavenCentral() +// jcenter() +// maven { +// url = "$rootProject.projectDir/repos" +// } } dependencies { @@ -22,7 +22,8 @@ buildscript { allprojects { repositories { google() - jcenter() + mavenCentral() +// jcenter() maven { url 'https://jitpack.io' } } } diff --git a/flap-animation/.gitignore b/flap-animation/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/flap-animation/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/flap-animation/build.gradle b/flap-animation/build.gradle new file mode 100644 index 00000000..10abec30 --- /dev/null +++ b/flap-animation/build.gradle @@ -0,0 +1,48 @@ +plugins { + id 'com.android.library' + id 'kotlin-android' +} + +apply plugin: 'com.github.dcendents.android-maven' + +group = 'me.yifeiyuan' + +android { + compileSdkVersion 29 + + defaultConfig { + minSdkVersion 17 + targetSdkVersion 29 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' + } + + 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' + } +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + + compileOnly 'androidx.recyclerview:recyclerview:1.2.1' + compileOnly project(':flap') +} \ No newline at end of file diff --git a/flap-animation/consumer-rules.pro b/flap-animation/consumer-rules.pro new file mode 100644 index 00000000..e69de29b diff --git a/flap-animation/proguard-rules.pro b/flap-animation/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/flap-animation/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# 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 \ No newline at end of file diff --git a/flap-animation/src/androidTest/java/me/yifeiyuan/flap/animation/ExampleInstrumentedTest.kt b/flap-animation/src/androidTest/java/me/yifeiyuan/flap/animation/ExampleInstrumentedTest.kt new file mode 100644 index 00000000..22c339ad --- /dev/null +++ b/flap-animation/src/androidTest/java/me/yifeiyuan/flap/animation/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package me.yifeiyuan.flap.animation + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("me.yifeiyuan.flap.animation.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/flap-animation/src/main/AndroidManifest.xml b/flap-animation/src/main/AndroidManifest.xml new file mode 100644 index 00000000..5644fc5d --- /dev/null +++ b/flap-animation/src/main/AndroidManifest.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/flap/src/main/java/me/yifeiyuan/flap/animation/AlphaInAdapterAnimation.kt b/flap-animation/src/main/java/me/yifeiyuan/flap/animation/AlphaInAdapterAnimation.kt similarity index 100% rename from flap/src/main/java/me/yifeiyuan/flap/animation/AlphaInAdapterAnimation.kt rename to flap-animation/src/main/java/me/yifeiyuan/flap/animation/AlphaInAdapterAnimation.kt diff --git a/flap/src/main/java/me/yifeiyuan/flap/animation/BaseAdapterAnimation.kt b/flap-animation/src/main/java/me/yifeiyuan/flap/animation/BaseAdapterAnimation.kt similarity index 100% rename from flap/src/main/java/me/yifeiyuan/flap/animation/BaseAdapterAnimation.kt rename to flap-animation/src/main/java/me/yifeiyuan/flap/animation/BaseAdapterAnimation.kt diff --git a/flap/src/main/java/me/yifeiyuan/flap/animation/ScaleInAdapterAnimation.kt b/flap-animation/src/main/java/me/yifeiyuan/flap/animation/ScaleInAdapterAnimation.kt similarity index 100% rename from flap/src/main/java/me/yifeiyuan/flap/animation/ScaleInAdapterAnimation.kt rename to flap-animation/src/main/java/me/yifeiyuan/flap/animation/ScaleInAdapterAnimation.kt diff --git a/flap/src/main/java/me/yifeiyuan/flap/animation/SlideInBottomAdapterAnimation.kt b/flap-animation/src/main/java/me/yifeiyuan/flap/animation/SlideInBottomAdapterAnimation.kt similarity index 100% rename from flap/src/main/java/me/yifeiyuan/flap/animation/SlideInBottomAdapterAnimation.kt rename to flap-animation/src/main/java/me/yifeiyuan/flap/animation/SlideInBottomAdapterAnimation.kt diff --git a/flap/src/main/java/me/yifeiyuan/flap/animation/SlideInLeftAdapterAnimation.kt b/flap-animation/src/main/java/me/yifeiyuan/flap/animation/SlideInLeftAdapterAnimation.kt similarity index 100% rename from flap/src/main/java/me/yifeiyuan/flap/animation/SlideInLeftAdapterAnimation.kt rename to flap-animation/src/main/java/me/yifeiyuan/flap/animation/SlideInLeftAdapterAnimation.kt diff --git a/flap/src/main/java/me/yifeiyuan/flap/animation/SlideInRightAdapterAnimation.kt b/flap-animation/src/main/java/me/yifeiyuan/flap/animation/SlideInRightAdapterAnimation.kt similarity index 100% rename from flap/src/main/java/me/yifeiyuan/flap/animation/SlideInRightAdapterAnimation.kt rename to flap-animation/src/main/java/me/yifeiyuan/flap/animation/SlideInRightAdapterAnimation.kt diff --git a/flap-animation/src/test/java/me/yifeiyuan/flap/animation/ExampleUnitTest.kt b/flap-animation/src/test/java/me/yifeiyuan/flap/animation/ExampleUnitTest.kt new file mode 100644 index 00000000..c1dd6367 --- /dev/null +++ b/flap-animation/src/test/java/me/yifeiyuan/flap/animation/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package me.yifeiyuan.flap.animation + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/flap-compiler/build.gradle b/flap-compiler/build.gradle index 98cb066b..fec5f3b1 100644 --- a/flap-compiler/build.gradle +++ b/flap-compiler/build.gradle @@ -9,8 +9,8 @@ dependencies { implementation project(':flap-annotations') implementation 'com.squareup:javapoet:1.11.1' // implementation 'com.squareup:kotlinpoet:1.10.1' - api 'com.google.auto.service:auto-service:1.0-rc6' - annotationProcessor 'com.google.auto.service:auto-service:1.0-rc6' + api 'com.google.auto.service:auto-service:1.0-rc7' + annotationProcessor 'com.google.auto.service:auto-service:1.0-rc7' implementation 'com.google.guava:guava:21.0' } diff --git a/flap-dsl-databinding/build.gradle b/flap-dsl-databinding/build.gradle index f96f285e..7718eb66 100644 --- a/flap-dsl-databinding/build.gradle +++ b/flap-dsl-databinding/build.gradle @@ -30,6 +30,7 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + kotlinOptions { jvmTarget = '1.8' } @@ -40,12 +41,10 @@ android { } dependencies { - testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' compileOnly 'androidx.recyclerview:recyclerview:1.2.1' - compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - compileOnly project(':flap') + api project(':flap') } \ No newline at end of file diff --git a/flap-dsl-viewbinding/build.gradle b/flap-dsl-viewbinding/build.gradle index 1f063c56..9a83ce5e 100644 --- a/flap-dsl-viewbinding/build.gradle +++ b/flap-dsl-viewbinding/build.gradle @@ -26,10 +26,12 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } + compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + kotlinOptions { jvmTarget = '1.8' } @@ -40,12 +42,10 @@ android { } dependencies { - testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' compileOnly 'androidx.recyclerview:recyclerview:1.2.1' - compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - compileOnly project(':flap') + api project(':flap') } \ No newline at end of file diff --git a/flap/build.gradle b/flap/build.gradle index 1f450ccc..cf0cb31c 100644 --- a/flap/build.gradle +++ b/flap/build.gradle @@ -41,7 +41,8 @@ dependencies { testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' - implementation 'androidx.recyclerview:recyclerview:1.2.1' - implementation "androidx.core:core-ktx:1.6.0" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + compileOnly 'androidx.recyclerview:recyclerview:1.2.1' + compileOnly "androidx.core:core-ktx:1.6.0" + + compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" } \ No newline at end of file diff --git a/ktmodule/build.gradle b/ktmodule/build.gradle index f5bb3c83..68e61634 100644 --- a/ktmodule/build.gradle +++ b/ktmodule/build.gradle @@ -1,15 +1,20 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' -apply plugin: 'kotlin-kapt' +//apply plugin: 'com.android.library' +//apply plugin: 'kotlin-android' +//apply plugin: 'kotlin-android-extensions' +//apply plugin: 'kotlin-kapt' + +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' +} android { - compileSdkVersion 30 - buildToolsVersion "30.0.0" + compileSdkVersion 29 defaultConfig { minSdkVersion 17 - targetSdkVersion 30 + targetSdkVersion 29 versionCode 1 versionName "1.0" diff --git a/settings.gradle b/settings.gradle index 0b8b2121..cdc5c81b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,7 +1,8 @@ +include ':flap-animation' include ':flap-dsl-databinding' include ':flap-dsl-viewbinding' include ':ktmodule' -include ':flap-gradle-plugin' +//include ':flap-gradle-plugin' include ':app' include ':flap' include ':flap-annotations'