Skip to content
This repository was archived by the owner on Oct 28, 2022. It is now read-only.

Commit 293c7fa

Browse files
[General] Split bindings into separate library module & fixed issue with nested converter generation
1 parent 2b78439 commit 293c7fa

File tree

59 files changed

+230
-136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+230
-136
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,5 @@ jobs:
1111
java-version: 11
1212
- run: chmod +x gradlew
1313
- run: chmod -R 777 ./
14-
- name: Build Library
15-
run: ./gradlew autobindings:build
16-
- name: Build Compiler
17-
run: ./gradlew autobindings-compiler:build
18-
- name: Run Tests
19-
run: ./gradlew lint:test
14+
# Build project & run tests
15+
- run: ./gradlew build

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414
.externalNativeBuild
1515
.cxx
1616
/key.asc
17-
*.gpg
17+
*.gpg
18+
lint-report.html

README.md

Lines changed: 6 additions & 2 deletions
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apply plugin: 'java-library'
2+
apply plugin: 'kotlin'
3+
4+
dependencies {
5+
implementation fileTree(dir: 'libs', include: ['*.jar'])
6+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
7+
// implementation 'com.android.support:support-annotations:28.0.0'
8+
implementation 'androidx.annotation:annotation:1.1.0'
9+
}
10+
11+
sourceCompatibility = "1.7"
12+
targetCompatibility = "1.7"
13+
14+
ext {
15+
PUBLISH_GROUP_ID = 'io.github.kaustubhpatange'
16+
PUBLISH_ARTIFACT_ID = 'autobindings-annotations-converter-core'
17+
PUBLISH_VERSION = versions.library
18+
}
19+
20+
apply from: rootProject.file('publish.gradle')
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.kpstv.bindings
2+
3+
enum class ConverterType {
4+
GSON, MOSHI, KOTLIN_SERIALIZATION
5+
}

autobindings-annotations/build.gradle renamed to autobindings-annotations-recyclerview/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ targetCompatibility = "1.7"
1313

1414
ext {
1515
PUBLISH_GROUP_ID = 'io.github.kaustubhpatange'
16-
PUBLISH_ARTIFACT_ID = 'autobindings-annotations'
16+
PUBLISH_ARTIFACT_ID = 'autobindings-annotations-recyclerview'
1717
PUBLISH_VERSION = versions.library
1818
}
1919

File renamed without changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apply plugin: 'java-library'
2+
apply plugin: 'kotlin'
3+
4+
dependencies {
5+
implementation fileTree(dir: 'libs', include: ['*.jar'])
6+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
7+
// implementation 'com.android.support:support-annotations:28.0.0'
8+
implementation 'androidx.annotation:annotation:1.1.0'
9+
api project(":autobindings-annotations-converter-core")
10+
}
11+
12+
sourceCompatibility = "1.7"
13+
targetCompatibility = "1.7"
14+
15+
ext {
16+
PUBLISH_GROUP_ID = 'io.github.kaustubhpatange'
17+
PUBLISH_ARTIFACT_ID = 'autobindings-annotations-room'
18+
PUBLISH_VERSION = versions.library
19+
}
20+
21+
apply from: rootProject.file('publish.gradle')

autobindings-annotations/src/main/java/com/kpstv/bindings/AutoGenerateConverter.kt renamed to autobindings-annotations-room/src/main/java/com/kpstv/bindings/AutoGenerateConverter.kt

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,4 @@ annotation class AutoGeneratePairConverter(val keyClass: KClass<*>, val using: C
4747
*/
4848
@Target(AnnotationTarget.FIELD)
4949
@Retention(AnnotationRetention.SOURCE)
50-
annotation class IgnoreConverter
51-
52-
/**
53-
* Automatically generate [SQLDelightAdapter] for SQLDelight.
54-
*
55-
* @see <a href="https://github.com/KaustubhPatange/AutoBindings/wiki/ColumnAdapter-Generation">Documentation</a>
56-
*/
57-
@Target(AnnotationTarget.CLASS)
58-
@Retention(AnnotationRetention.SOURCE)
59-
annotation class AutoGenerateSQLDelightAdapters(val using: ConverterType)
60-
61-
enum class ConverterType {
62-
GSON, MOSHI, KOTLIN_SERIALIZATION
63-
}
50+
annotation class IgnoreConverter
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apply plugin: 'java-library'
2+
apply plugin: 'kotlin'
3+
4+
dependencies {
5+
implementation fileTree(dir: 'libs', include: ['*.jar'])
6+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
7+
// implementation 'com.android.support:support-annotations:28.0.0'
8+
implementation 'androidx.annotation:annotation:1.1.0'
9+
api project(":autobindings-annotations-converter-core")
10+
}
11+
12+
sourceCompatibility = "1.7"
13+
targetCompatibility = "1.7"
14+
15+
ext {
16+
PUBLISH_GROUP_ID = 'io.github.kaustubhpatange'
17+
PUBLISH_ARTIFACT_ID = 'autobindings-annotations-sqldelight'
18+
PUBLISH_VERSION = versions.library
19+
}
20+
21+
apply from: rootProject.file('publish.gradle')
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.kpstv.bindings
2+
3+
/**
4+
* Automatically generate [SQLDelightAdapter] for SQLDelight.
5+
*
6+
* @see <a href="https://github.com/KaustubhPatange/AutoBindings/wiki/ColumnAdapter-Generation">Documentation</a>
7+
*/
8+
@Target(AnnotationTarget.CLASS)
9+
@Retention(AnnotationRetention.SOURCE)
10+
annotation class AutoGenerateSQLDelightAdapters(val using: ConverterType)

autobindings-recyclerview/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

autobindings/build.gradle renamed to autobindings-recyclerview/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,30 @@ android {
99
buildFeatures.buildConfig false
1010
defaultConfig {
1111
minSdkVersion 16
12-
13-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
14-
consumerProguardFiles "consumer-rules.pro"
1512
}
1613

1714
buildTypes {
1815
release {
1916
minifyEnabled false
20-
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
2117
}
2218
}
19+
compileOptions {
20+
sourceCompatibility JavaVersion.VERSION_1_8
21+
targetCompatibility JavaVersion.VERSION_1_8
22+
}
2323
}
2424

2525
dependencies {
2626
implementation fileTree(dir: "libs", include: ["*.jar"])
2727
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
2828

29-
api project(":autobindings-annotations")
29+
api project(":autobindings-annotations-recyclerview")
3030
lintPublish project(":lint")
3131
}
3232

3333
ext {
3434
PUBLISH_GROUP_ID = 'io.github.kaustubhpatange'
35-
PUBLISH_ARTIFACT_ID = 'autobindings'
35+
PUBLISH_ARTIFACT_ID = 'autobindings-recyclerview'
3636
PUBLISH_VERSION = versions.library
3737
}
3838

autobindings-room/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

autobindings-room/build.gradle

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
apply plugin: 'com.android.library'
2+
apply plugin: 'kotlin-android'
3+
apply plugin: 'kotlin-kapt'
4+
apply plugin: 'maven-publish'
5+
6+
android {
7+
compileSdkVersion 30
8+
9+
buildFeatures.buildConfig false
10+
defaultConfig {
11+
minSdkVersion 16
12+
}
13+
14+
buildTypes {
15+
release {
16+
minifyEnabled false
17+
}
18+
}
19+
compileOptions {
20+
sourceCompatibility JavaVersion.VERSION_1_8
21+
targetCompatibility JavaVersion.VERSION_1_8
22+
}
23+
}
24+
25+
dependencies {
26+
implementation fileTree(dir: "libs", include: ["*.jar"])
27+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
28+
29+
api project(":autobindings-annotations-room")
30+
lintPublish project(":lint")
31+
}
32+
33+
ext {
34+
PUBLISH_GROUP_ID = 'io.github.kaustubhpatange'
35+
PUBLISH_ARTIFACT_ID = 'autobindings-room'
36+
PUBLISH_VERSION = versions.library
37+
}
38+
39+
apply from: "${rootProject.projectDir}/publish.gradle"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.kpstv.bindings"/>

autobindings-sqldelight/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

autobindings-sqldelight/build.gradle

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
apply plugin: 'com.android.library'
2+
apply plugin: 'kotlin-android'
3+
apply plugin: 'kotlin-kapt'
4+
apply plugin: 'maven-publish'
5+
6+
android {
7+
compileSdkVersion 30
8+
9+
buildFeatures.buildConfig false
10+
defaultConfig {
11+
minSdkVersion 16
12+
}
13+
14+
buildTypes {
15+
release {
16+
minifyEnabled false
17+
}
18+
}
19+
compileOptions {
20+
sourceCompatibility JavaVersion.VERSION_1_8
21+
targetCompatibility JavaVersion.VERSION_1_8
22+
}
23+
}
24+
25+
dependencies {
26+
implementation fileTree(dir: "libs", include: ["*.jar"])
27+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
28+
29+
api project(":autobindings-annotations-sqldelight")
30+
lintPublish project(":lint")
31+
}
32+
33+
ext {
34+
PUBLISH_GROUP_ID = 'io.github.kaustubhpatange'
35+
PUBLISH_ARTIFACT_ID = 'autobindings-sqldelight'
36+
PUBLISH_VERSION = versions.library
37+
}
38+
39+
apply from: "${rootProject.projectDir}/publish.gradle"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.kpstv.bindings"/>

autobindings/consumer-rules.pro

Whitespace-only changes.

autobindings/proguard-rules.pro

Lines changed: 0 additions & 21 deletions
This file was deleted.

build.gradle

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
ext.androidGradlePlugin = "7.0.0"
66
ext.lintVersion = "30.0.0" // Lint version = 23.0.0 + androidGradlePlugin version
77
ext.versions = [
8-
'library': "1.1-beta04" // TODO: Increment version for every new release & run the task at bottom to publish it
8+
'library': "1.1-beta05" // TODO: Increment version for every new release & run the task at bottom to publish it
99
]
1010
repositories {
1111
google()
@@ -33,24 +33,39 @@ task clean(type: Delete) {
3333
}
3434

3535
tasks.register("publishAllLibrariesToMavenCentral") {
36-
def t1 = tasks.getByPath("autobindings-annotations:publish")
37-
def t2 = tasks.getByPath("autobindings-compiler:publish")
36+
def t1 = tasks.getByPath("autobindings-recyclerview:publish")
37+
def t2 = tasks.getByPath("compiler:publish")
3838
def t3 = tasks.getByPath("autobindings-room-noop:publish")
39-
def t4 = tasks.getByPath("autobindings:publish")
39+
def t4 = tasks.getByPath("autobindings-room:publish")
40+
def t5 = tasks.getByPath("autobindings-sqldelight:publish")
41+
def t6 = tasks.getByPath("autobindings-annotations-converter-core:publish")
42+
def t7 = tasks.getByPath("autobindings-annotations-room:publish")
43+
def t8 = tasks.getByPath("autobindings-annotations-sqldelight:publish")
44+
def t9 = tasks.getByPath("autobindings-annotations-recyclerview:publish")
4045

41-
def t5 = tasks.getByName("closeRepository")
42-
def t6 = tasks.getByName("releaseRepository")
46+
def t10 = tasks.getByName("closeRepository")
47+
def t11 = tasks.getByName("releaseRepository")
4348

4449
t2.mustRunAfter(t1)
4550
t3.mustRunAfter(t2)
4651
t4.mustRunAfter(t3)
4752
t5.mustRunAfter(t4)
4853
t6.mustRunAfter(t5)
54+
t7.mustRunAfter(t6)
55+
t8.mustRunAfter(t7)
56+
t9.mustRunAfter(t8)
57+
t10.mustRunAfter(t9)
58+
t11.mustRunAfter(t10)
4959

5060
dependsOn(t1)
5161
dependsOn(t2)
5262
dependsOn(t3)
5363
dependsOn(t4)
5464
dependsOn(t5)
5565
dependsOn(t6)
66+
dependsOn(t7)
67+
dependsOn(t8)
68+
dependsOn(t9)
69+
dependsOn(t10)
70+
dependsOn(t11)
5671
}

compiler/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

autobindings-compiler/build.gradle renamed to compiler/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ dependencies {
55
implementation fileTree(dir: 'libs', include: ['*.jar'])
66
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
77
implementation 'com.squareup:javapoet:1.12.1'
8-
compileOnly project(":autobindings-annotations")
8+
9+
implementation project(":autobindings-annotations-recyclerview")
10+
implementation project(":autobindings-annotations-room")
11+
implementation project(":autobindings-annotations-sqldelight")
12+
913
compileOnly 'com.google.android.material:material:1.2.0-beta01'
1014
}
1115

0 commit comments

Comments
 (0)