From 64d7d3fb53306236466cb9c555129fed7557158d Mon Sep 17 00:00:00 2001 From: Teodor Grigor Date: Thu, 15 Feb 2024 21:25:17 +0200 Subject: [PATCH 1/4] Remove unused elements (cleanup) --- codegen/api/codegen.api | 9 ---- .../stitch/codegen/commons/Constants.kt | 46 +++++++++++-------- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/codegen/api/codegen.api b/codegen/api/codegen.api index a87324b..f8a1078 100644 --- a/codegen/api/codegen.api +++ b/codegen/api/codegen.api @@ -6,15 +6,6 @@ public final class dev/teogor/stitch/codegen/CodeGenerator : dev/teogor/stitch/c } public final class dev/teogor/stitch/codegen/commons/ConstantsKt { - public static final field ACTIVITY_DESTINATION_ANNOTATION Ljava/lang/String; - public static final field CORE_PACKAGE_NAME Ljava/lang/String; - public static final field DAO_ANNOTATION Ljava/lang/String; - public static final field DAO_ANNOTATION_QUALIFIED Ljava/lang/String; - public static final field DESTINATION_ANNOTATION Ljava/lang/String; - public static final field ENTITY_ANNOTATION Ljava/lang/String; - public static final field NAV_GRAPH_ANNOTATION Ljava/lang/String; - public static final field NAV_TYPE_SERIALIZER_ANNOTATION Ljava/lang/String; - public static final field ROOM_PACKAGE_NAME Ljava/lang/String; public static final fun getDAGGER_APPLICATION_CONTEXT ()Lcom/squareup/kotlinpoet/ClassName; public static final fun getDAGGER_INSTALL_IN ()Lcom/squareup/kotlinpoet/ClassName; public static final fun getDAGGER_MODULE ()Lcom/squareup/kotlinpoet/ClassName; diff --git a/codegen/src/main/kotlin/dev/teogor/stitch/codegen/commons/Constants.kt b/codegen/src/main/kotlin/dev/teogor/stitch/codegen/commons/Constants.kt index 4823137..55dca1c 100644 --- a/codegen/src/main/kotlin/dev/teogor/stitch/codegen/commons/Constants.kt +++ b/codegen/src/main/kotlin/dev/teogor/stitch/codegen/commons/Constants.kt @@ -18,21 +18,31 @@ package dev.teogor.stitch.codegen.commons import com.squareup.kotlinpoet.ClassName -const val CORE_PACKAGE_NAME = "dev.teogor.stitch" -const val ROOM_PACKAGE_NAME = "androidx.room" - -const val DESTINATION_ANNOTATION = "Destination" -const val DAO_ANNOTATION = "Dao" -const val ENTITY_ANNOTATION = "Entity" -const val ACTIVITY_DESTINATION_ANNOTATION = "ActivityDestination" -const val NAV_GRAPH_ANNOTATION = "NavGraph" -const val NAV_TYPE_SERIALIZER_ANNOTATION = "NavTypeSerializer" -const val DAO_ANNOTATION_QUALIFIED = "$ROOM_PACKAGE_NAME.$DAO_ANNOTATION" - -val DAGGER_MODULE = ClassName("dagger", "Module") -val DAGGER_PROVIDES = ClassName("dagger", "Provides") -val DAGGER_INSTALL_IN = ClassName("dagger.hilt", "InstallIn") -val DAGGER_APPLICATION_CONTEXT = ClassName("dagger.hilt.android.qualifiers", "ApplicationContext") -val DAGGER_SINGLETON_COMPONENT = ClassName("dagger.hilt.components", "SingletonComponent") -val JAVAX_INJECT_SINGLETON = ClassName("javax.inject", "Singleton") -val JAVAX_INJECT = ClassName("javax.inject", "Inject") +val DAGGER_MODULE = ClassName( + packageName = "dagger", + "Module", +) +val DAGGER_PROVIDES = ClassName( + packageName = "dagger", + "Provides", +) +val DAGGER_INSTALL_IN = ClassName( + packageName = "dagger.hilt", + "InstallIn", +) +val DAGGER_APPLICATION_CONTEXT = ClassName( + packageName = "dagger.hilt.android.qualifiers", + "ApplicationContext", +) +val DAGGER_SINGLETON_COMPONENT = ClassName( + packageName = "dagger.hilt.components", + "SingletonComponent", +) +val JAVAX_INJECT_SINGLETON = ClassName( + packageName = "javax.inject", + "Singleton", +) +val JAVAX_INJECT = ClassName( + packageName = "javax.inject", + "Inject", +) From 212fc4d161432f313a024f26c2131f436e047500 Mon Sep 17 00:00:00 2001 From: Teodor Grigor Date: Thu, 15 Feb 2024 21:26:10 +0200 Subject: [PATCH 2/4] Bump dependencies to latest versions --- gradle/libs.versions.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b7d762a..ed2163c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,11 +7,11 @@ junit-version = "1.1.5" espresso-core = "3.5.1" lifecycle-runtime-ktx = "2.7.0" activity-compose = "1.8.2" -compose-bom = "2024.01.00" +compose-bom = "2024.02.00" ceres = "1.0.0-alpha04" ksp = "1.9.22-1.0.17" room = "2.6.1" -hilt = "2.48.1" +hilt = "2.50" hiltExt = "1.1.0" kotlin-poet = "1.14.2" gradle-publish = "1.1.0" From 4a8508f1fd8c27eccb8a550943cf79c419be2860 Mon Sep 17 00:00:00 2001 From: Teodor Grigor Date: Thu, 15 Feb 2024 21:27:32 +0200 Subject: [PATCH 3/4] Enhance demo with new capabilities & use cases --- app/build.gradle.kts | 4 +- .../2.json | 299 ++++++++++++++++++ .../1.json | 206 ++++++++++++ .../zeoowl/beatifyd/core/data/AppDatabase.kt | 70 ++++ .../core/data/dao/BlackListStoreDao.kt | 48 +++ .../beatifyd/core/data/dao/HistoryDao.kt | 48 +++ .../beatifyd/core/data/dao/LyricsDao.kt | 39 +++ .../beatifyd/core/data/dao/PlaylistDao.kt | 94 ++++++ .../core/data/model/BlackListStoreEntity.kt | 25 ++ .../beatifyd/core/data/model/History.kt | 47 +++ .../zeoowl/beatifyd/core/data/model/Lyrics.kt | 26 ++ .../beatifyd/core/data/model/Playlist.kt | 31 ++ .../core/data/model/PlaylistWithSongs.kt | 29 ++ .../zeoowl/beatifyd/core/data/model/Song.kt | 75 +++++ 14 files changed, 1039 insertions(+), 2 deletions(-) create mode 100644 app/schemas/com.zeoowl.beatifyd.core.data.AppDatabase/2.json create mode 100644 app/schemas/dev.teogor.stitch.core.database.AppDatabase/1.json create mode 100644 app/src/main/kotlin/com/zeoowl/beatifyd/core/data/AppDatabase.kt create mode 100644 app/src/main/kotlin/com/zeoowl/beatifyd/core/data/dao/BlackListStoreDao.kt create mode 100644 app/src/main/kotlin/com/zeoowl/beatifyd/core/data/dao/HistoryDao.kt create mode 100644 app/src/main/kotlin/com/zeoowl/beatifyd/core/data/dao/LyricsDao.kt create mode 100644 app/src/main/kotlin/com/zeoowl/beatifyd/core/data/dao/PlaylistDao.kt create mode 100644 app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/BlackListStoreEntity.kt create mode 100644 app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/History.kt create mode 100644 app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/Lyrics.kt create mode 100644 app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/Playlist.kt create mode 100644 app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/PlaylistWithSongs.kt create mode 100644 app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/Song.kt diff --git a/app/build.gradle.kts b/app/build.gradle.kts index b58f903..5c07654 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -19,12 +19,12 @@ plugins { alias(libs.plugins.ceres.android.room) alias(libs.plugins.ceres.android.hilt) alias(libs.plugins.ksp) - // id("dev.teogor.stitch") } ksp { arg("stitch.addDocumentation", "true") - arg("stitch.generateOperations", "true") + arg("stitch.enableOperationGeneration", "true") + arg("stitch.operationGenerationLevel", "explicit") arg("stitch.generatedPackageName", "dev.teogor.stitch") } diff --git a/app/schemas/com.zeoowl.beatifyd.core.data.AppDatabase/2.json b/app/schemas/com.zeoowl.beatifyd.core.data.AppDatabase/2.json new file mode 100644 index 0000000..09651ba --- /dev/null +++ b/app/schemas/com.zeoowl.beatifyd.core.data.AppDatabase/2.json @@ -0,0 +1,299 @@ +{ + "formatVersion": 1, + "database": { + "version": 2, + "identityHash": "faf6eea4a0a81680ed4dfed8c6fe0ba8", + "entities": [ + { + "tableName": "BlackListStoreEntity", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`path` TEXT NOT NULL, PRIMARY KEY(`path`))", + "fields": [ + { + "fieldPath": "path", + "columnName": "path", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "path" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "History", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `title` TEXT NOT NULL, `track_number` INTEGER NOT NULL, `year` INTEGER NOT NULL, `duration` INTEGER NOT NULL, `data` TEXT NOT NULL, `date_modified` INTEGER NOT NULL, `album_id` INTEGER NOT NULL, `album_name` TEXT NOT NULL, `artist_id` INTEGER NOT NULL, `artist_name` TEXT NOT NULL, `composer` TEXT, `album_artist` TEXT, `time_played` INTEGER NOT NULL, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "title", + "columnName": "title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "trackNumber", + "columnName": "track_number", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "year", + "columnName": "year", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "duration", + "columnName": "duration", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dateModified", + "columnName": "date_modified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "albumName", + "columnName": "album_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "artistId", + "columnName": "artist_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "artistName", + "columnName": "artist_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "composer", + "columnName": "composer", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumArtist", + "columnName": "album_artist", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "timePlayed", + "columnName": "time_played", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "Lyrics", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`songId` INTEGER NOT NULL, `lyrics` TEXT NOT NULL, PRIMARY KEY(`songId`))", + "fields": [ + { + "fieldPath": "songId", + "columnName": "songId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "lyrics", + "columnName": "lyrics", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "songId" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "Playlist", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`playlist_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `playlist_name` TEXT NOT NULL)", + "fields": [ + { + "fieldPath": "playListId", + "columnName": "playlist_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "playlistName", + "columnName": "playlist_name", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "playlist_id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "Song", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`song_key` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `playlist_creator_id` INTEGER NOT NULL, `id` INTEGER NOT NULL, `title` TEXT NOT NULL, `track_number` INTEGER NOT NULL, `year` INTEGER NOT NULL, `duration` INTEGER NOT NULL, `data` TEXT NOT NULL, `date_modified` INTEGER NOT NULL, `album_id` INTEGER NOT NULL, `album_name` TEXT NOT NULL, `artist_id` INTEGER NOT NULL, `artist_name` TEXT NOT NULL, `composer` TEXT, `album_artist` TEXT)", + "fields": [ + { + "fieldPath": "songPrimaryKey", + "columnName": "song_key", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "playlistCreatorId", + "columnName": "playlist_creator_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "title", + "columnName": "title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "trackNumber", + "columnName": "track_number", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "year", + "columnName": "year", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "duration", + "columnName": "duration", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dateModified", + "columnName": "date_modified", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "albumId", + "columnName": "album_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "albumName", + "columnName": "album_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "artistId", + "columnName": "artist_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "artistName", + "columnName": "artist_name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "composer", + "columnName": "composer", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "albumArtist", + "columnName": "album_artist", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "song_key" + ] + }, + "indices": [ + { + "name": "index_Song_playlist_creator_id_id", + "unique": true, + "columnNames": [ + "playlist_creator_id", + "id" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_Song_playlist_creator_id_id` ON `${TABLE_NAME}` (`playlist_creator_id`, `id`)" + } + ], + "foreignKeys": [] + } + ], + "views": [], + "setupQueries": [ + "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'faf6eea4a0a81680ed4dfed8c6fe0ba8')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/dev.teogor.stitch.core.database.AppDatabase/1.json b/app/schemas/dev.teogor.stitch.core.database.AppDatabase/1.json new file mode 100644 index 0000000..5f040f8 --- /dev/null +++ b/app/schemas/dev.teogor.stitch.core.database.AppDatabase/1.json @@ -0,0 +1,206 @@ +{ + "formatVersion": 1, + "database": { + "version": 1, + "identityHash": "062b80b21fc6d8728880cf6ad688cf4b", + "entities": [ + { + "tableName": "testing_kind", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `board_id` INTEGER NOT NULL, `current_board` TEXT NOT NULL, `notes` TEXT NOT NULL, `timer` INTEGER NOT NULL, `completed` INTEGER NOT NULL DEFAULT false, `give_up` INTEGER NOT NULL DEFAULT false, `mistakes` INTEGER NOT NULL DEFAULT 0, `can_continue` INTEGER NOT NULL, `last_played` INTEGER, `started_at` INTEGER NOT NULL, `finished_at` INTEGER, `hints_used` INTEGER NOT NULL DEFAULT 0)", + "fields": [ + { + "fieldPath": "uid", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "boardId", + "columnName": "board_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "currentBoard", + "columnName": "current_board", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "notes", + "columnName": "notes", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timer", + "columnName": "timer", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "completed", + "columnName": "completed", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "false" + }, + { + "fieldPath": "giveUp", + "columnName": "give_up", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "false" + }, + { + "fieldPath": "mistakes", + "columnName": "mistakes", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "canContinue", + "columnName": "can_continue", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "lastPlayed", + "columnName": "last_played", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "startedAt", + "columnName": "started_at", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "finishedAt", + "columnName": "finished_at", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "hintsUsed", + "columnName": "hints_used", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "saved_games", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `board_id` INTEGER NOT NULL, `current_board` TEXT NOT NULL, `notes` TEXT NOT NULL, `timer` INTEGER NOT NULL, `completed` INTEGER NOT NULL DEFAULT false, `give_up` INTEGER NOT NULL DEFAULT false, `mistakes` INTEGER NOT NULL DEFAULT 0, `can_continue` INTEGER NOT NULL, `last_played` INTEGER, `started_at` INTEGER NOT NULL, `finished_at` INTEGER, `hints_used` INTEGER NOT NULL DEFAULT 0)", + "fields": [ + { + "fieldPath": "uid", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "boardId", + "columnName": "board_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "currentBoard", + "columnName": "current_board", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "notes", + "columnName": "notes", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timer", + "columnName": "timer", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "completed", + "columnName": "completed", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "false" + }, + { + "fieldPath": "giveUp", + "columnName": "give_up", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "false" + }, + { + "fieldPath": "mistakes", + "columnName": "mistakes", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "canContinue", + "columnName": "can_continue", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "lastPlayed", + "columnName": "last_played", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "startedAt", + "columnName": "started_at", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "finishedAt", + "columnName": "finished_at", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "hintsUsed", + "columnName": "hints_used", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "id" + ] + }, + "indices": [], + "foreignKeys": [] + } + ], + "views": [], + "setupQueries": [ + "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '062b80b21fc6d8728880cf6ad688cf4b')" + ] + } +} \ No newline at end of file diff --git a/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/AppDatabase.kt b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/AppDatabase.kt new file mode 100644 index 0000000..f391dff --- /dev/null +++ b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/AppDatabase.kt @@ -0,0 +1,70 @@ +/* + * Copyright 2024 teogor (Teodor Grigor) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zeoowl.beatifyd.core.data + +import android.content.Context +import androidx.room.Database +import androidx.room.Room +import androidx.room.RoomDatabase +import androidx.room.TypeConverters +import com.zeoowl.beatifyd.core.data.dao.BlackListStoreDao +import com.zeoowl.beatifyd.core.data.dao.HistoryDao +import com.zeoowl.beatifyd.core.data.dao.LyricsDao +import com.zeoowl.beatifyd.core.data.dao.PlaylistDao +import com.zeoowl.beatifyd.core.data.model.BlackListStoreEntity +import com.zeoowl.beatifyd.core.data.model.History +import com.zeoowl.beatifyd.core.data.model.Lyrics +import com.zeoowl.beatifyd.core.data.model.Playlist +import com.zeoowl.beatifyd.core.data.model.Song + +@Database( + entities = [ + BlackListStoreEntity::class, + History::class, + Lyrics::class, + Playlist::class, + Song::class, + ], + version = 2, +) +@TypeConverters +abstract class AppDatabase : RoomDatabase() { + + abstract fun blackListStoreDao(): BlackListStoreDao + + abstract fun historyDao(): HistoryDao + + abstract fun lyricsDao(): LyricsDao + + abstract fun playlistDao(): PlaylistDao + + companion object { + private var INSTANCE: AppDatabase? = null + + fun getInstance(context: Context): AppDatabase { + if (INSTANCE == null) { + INSTANCE = Room.databaseBuilder( + context, + AppDatabase::class.java, + "main_database", + ).build() + } + + return INSTANCE as AppDatabase + } + } +} diff --git a/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/dao/BlackListStoreDao.kt b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/dao/BlackListStoreDao.kt new file mode 100644 index 0000000..cbdef50 --- /dev/null +++ b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/dao/BlackListStoreDao.kt @@ -0,0 +1,48 @@ +/* + * Copyright 2024 teogor (Teodor Grigor) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zeoowl.beatifyd.core.data.dao + +import androidx.room.Dao +import androidx.room.Delete +import androidx.room.Insert +import androidx.room.OnConflictStrategy +import androidx.room.Query +import com.zeoowl.beatifyd.core.data.model.BlackListStoreEntity +import dev.teogor.stitch.ExplicitEntities + +@Dao +@ExplicitEntities( + entities = [ + BlackListStoreEntity::class, + ], +) +interface BlackListStoreDao { + @Insert(onConflict = OnConflictStrategy.REPLACE) + fun insertBlacklistPath(blackListStoreEntity: BlackListStoreEntity) + + @Insert(onConflict = OnConflictStrategy.REPLACE) + suspend fun insertBlacklistPath(blackListStoreEntityEntities: List) + + @Delete + suspend fun deleteBlacklistPath(blackListStoreEntity: BlackListStoreEntity) + + @Query("DELETE FROM BlackListStoreEntity") + suspend fun clearBlacklist() + + @Query("SELECT * FROM BlackListStoreEntity") + fun blackListPaths(): List +} diff --git a/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/dao/HistoryDao.kt b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/dao/HistoryDao.kt new file mode 100644 index 0000000..8fbed1e --- /dev/null +++ b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/dao/HistoryDao.kt @@ -0,0 +1,48 @@ +/* + * Copyright 2024 teogor (Teodor Grigor) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zeoowl.beatifyd.core.data.dao + +import androidx.room.Dao +import androidx.room.Query +import androidx.room.Upsert +import com.zeoowl.beatifyd.core.data.model.History +import dev.teogor.stitch.ExplicitEntities +import kotlinx.coroutines.flow.Flow + +@Dao +@ExplicitEntities( + entities = [ + History::class, + ], +) +interface HistoryDao { + companion object { + private const val HISTORY_LIMIT = 100 + } + + @Upsert + suspend fun upsertSongInHistory(history: History) + + @Query("DELETE FROM History WHERE id= :songId") + fun deleteSongInHistory(songId: Long) + + @Query("SELECT * FROM History ORDER BY time_played DESC LIMIT $HISTORY_LIMIT") + fun historySongs(): Flow> + + @Query("DELETE FROM History") + suspend fun clearHistory() +} diff --git a/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/dao/LyricsDao.kt b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/dao/LyricsDao.kt new file mode 100644 index 0000000..1c007f4 --- /dev/null +++ b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/dao/LyricsDao.kt @@ -0,0 +1,39 @@ +/* + * Copyright 2024 teogor (Teodor Grigor) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zeoowl.beatifyd.core.data.dao + +import androidx.room.Dao +import androidx.room.Delete +import androidx.room.Insert +import androidx.room.Query +import androidx.room.Update +import com.zeoowl.beatifyd.core.data.model.Lyrics + +@Dao +interface LyricsDao { + @Query("SELECT * FROM Lyrics WHERE songId =:songId LIMIT 1") + fun lyricsWithSongId(songId: Int): Lyrics? + + @Insert + fun insertLyrics(lyricsEntity: Lyrics) + + @Delete + fun deleteLyrics(lyricsEntity: Lyrics) + + @Update + fun updateLyrics(lyricsEntity: Lyrics) +} diff --git a/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/dao/PlaylistDao.kt b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/dao/PlaylistDao.kt new file mode 100644 index 0000000..9825484 --- /dev/null +++ b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/dao/PlaylistDao.kt @@ -0,0 +1,94 @@ +/* + * Copyright 2024 teogor (Teodor Grigor) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zeoowl.beatifyd.core.data.dao + +import androidx.room.Dao +import androidx.room.Delete +import androidx.room.Insert +import androidx.room.OnConflictStrategy +import androidx.room.Query +import androidx.room.RewriteQueriesToDropUnusedColumns +import androidx.room.Transaction +import com.zeoowl.beatifyd.core.data.model.Playlist +import com.zeoowl.beatifyd.core.data.model.PlaylistWithSongs +import com.zeoowl.beatifyd.core.data.model.Song +import dev.teogor.stitch.ExplicitEntities +import kotlinx.coroutines.flow.Flow + +@Dao +@ExplicitEntities( + entities = [ + Song::class, + ], +) +interface PlaylistDao { + @Insert + suspend fun createPlaylist(playlist: Playlist): Long + + @Query("UPDATE Playlist SET playlist_name = :name WHERE playlist_id = :playlistId") + suspend fun renamePlaylist(playlistId: Long, name: String) + + @Query("SELECT * FROM Playlist WHERE playlist_name = :name") + fun playlist(name: String): List + + @Query("SELECT * FROM Playlist") + suspend fun playlists(): List + + @Query("DELETE FROM Song WHERE playlist_creator_id = :playlistId") + suspend fun deletePlaylistSongs(playlistId: Long) + + @Query("DELETE FROM Song WHERE playlist_creator_id = :playlistId AND id = :songId") + suspend fun deleteSongFromPlaylist(playlistId: Long, songId: Long) + + @Transaction + @Query("SELECT * FROM Playlist") + suspend fun playlistsWithSongs(): List + + @Transaction + @Query("SELECT * FROM Playlist WHERE playlist_id= :playlistId") + fun getPlaylist(playlistId: Long): Flow + + @Insert(onConflict = OnConflictStrategy.REPLACE) + suspend fun insertSongsToPlaylist(songEntities: List) + + @Query("SELECT * FROM Song WHERE playlist_creator_id = :playlistId AND id = :songId") + suspend fun isSongExistsInPlaylist(playlistId: Long, songId: Long): List + + @Query("SELECT * FROM Song WHERE playlist_creator_id = :playlistId ORDER BY song_key asc") + fun songsFromPlaylist(playlistId: Long): Flow> + + @Delete + suspend fun deletePlaylist(playlist: Playlist) + + @Delete + suspend fun deletePlaylists(playlistEntities: List) + + @Delete + suspend fun deletePlaylistSongs(songs: List) + + @RewriteQueriesToDropUnusedColumns + @Query( + "SELECT * FROM Song ,(SELECT playlist_id FROM Playlist WHERE playlist_name= :playlistName LIMIT 1) AS playlist WHERE playlist_creator_id= playlist.playlist_id", + ) + fun favoritesSongsLiveData(playlistName: String): Flow> + + @Query("SELECT * FROM Song WHERE playlist_creator_id= :playlistId") + fun favoritesSongs(playlistId: Long): List + + @Query("SELECT EXISTS(SELECT * FROM Playlist WHERE playlist_id = :playlistId)") + fun checkPlaylistExists(playlistId: Long): Flow +} diff --git a/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/BlackListStoreEntity.kt b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/BlackListStoreEntity.kt new file mode 100644 index 0000000..77e9eb7 --- /dev/null +++ b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/BlackListStoreEntity.kt @@ -0,0 +1,25 @@ +/* + * Copyright 2024 teogor (Teodor Grigor) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zeoowl.beatifyd.core.data.model + +import androidx.room.Entity +import androidx.room.PrimaryKey + +@Entity +data class BlackListStoreEntity( + @PrimaryKey val path: String, +) diff --git a/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/History.kt b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/History.kt new file mode 100644 index 0000000..e8bd7ec --- /dev/null +++ b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/History.kt @@ -0,0 +1,47 @@ +/* + * Copyright 2024 teogor (Teodor Grigor) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zeoowl.beatifyd.core.data.model + +import androidx.room.ColumnInfo +import androidx.room.Entity +import androidx.room.PrimaryKey + +@Entity +data class History( + @PrimaryKey val id: Long, + val title: String, + @ColumnInfo(name = "track_number") + val trackNumber: Int, + val year: Int, + val duration: Long, + val data: String, + @ColumnInfo(name = "date_modified") + val dateModified: Long, + @ColumnInfo(name = "album_id") + val albumId: Long, + @ColumnInfo(name = "album_name") + val albumName: String, + @ColumnInfo(name = "artist_id") + val artistId: Long, + @ColumnInfo(name = "artist_name") + val artistName: String, + val composer: String?, + @ColumnInfo(name = "album_artist") + val albumArtist: String?, + @ColumnInfo(name = "time_played") + val timePlayed: Long, +) diff --git a/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/Lyrics.kt b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/Lyrics.kt new file mode 100644 index 0000000..6b48fc8 --- /dev/null +++ b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/Lyrics.kt @@ -0,0 +1,26 @@ +/* + * Copyright 2024 teogor (Teodor Grigor) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zeoowl.beatifyd.core.data.model + +import androidx.room.Entity +import androidx.room.PrimaryKey + +@Entity +data class Lyrics( + @PrimaryKey val songId: Int, + val lyrics: String, +) diff --git a/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/Playlist.kt b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/Playlist.kt new file mode 100644 index 0000000..7473afb --- /dev/null +++ b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/Playlist.kt @@ -0,0 +1,31 @@ +/* + * Copyright 2024 teogor (Teodor Grigor) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zeoowl.beatifyd.core.data.model + +import androidx.room.ColumnInfo +import androidx.room.Entity +import androidx.room.PrimaryKey + +@Entity +class Playlist( + @PrimaryKey(autoGenerate = true) + @ColumnInfo(name = "playlist_id") + val playListId: Long = 0, + + @ColumnInfo(name = "playlist_name") + val playlistName: String, +) diff --git a/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/PlaylistWithSongs.kt b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/PlaylistWithSongs.kt new file mode 100644 index 0000000..4281a7e --- /dev/null +++ b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/PlaylistWithSongs.kt @@ -0,0 +1,29 @@ +/* + * Copyright 2024 teogor (Teodor Grigor) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zeoowl.beatifyd.core.data.model + +import androidx.room.Embedded +import androidx.room.Relation + +data class PlaylistWithSongs( + @Embedded val playlist: Playlist, + @Relation( + parentColumn = "playlist_id", + entityColumn = "playlist_creator_id", + ) + val songs: List, +) diff --git a/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/Song.kt b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/Song.kt new file mode 100644 index 0000000..2bb1c3e --- /dev/null +++ b/app/src/main/kotlin/com/zeoowl/beatifyd/core/data/model/Song.kt @@ -0,0 +1,75 @@ +/* + * Copyright 2024 teogor (Teodor Grigor) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zeoowl.beatifyd.core.data.model + +import androidx.room.ColumnInfo +import androidx.room.Entity +import androidx.room.Index +import androidx.room.PrimaryKey + +@Entity( + indices = [ + Index( + value = [ + "playlist_creator_id", + "id", + ], + unique = true, + ), + ], +) +class Song( + @PrimaryKey(autoGenerate = true) + @ColumnInfo(name = "song_key") + val songPrimaryKey: Long = 0L, + + @ColumnInfo(name = "playlist_creator_id") + val playlistCreatorId: Long, + + val id: Long, + + val title: String, + + @ColumnInfo(name = "track_number") + val trackNumber: Int, + + val year: Int, + + val duration: Long, + + val data: String, + + @ColumnInfo(name = "date_modified") + val dateModified: Long, + + @ColumnInfo(name = "album_id") + val albumId: Long, + + @ColumnInfo(name = "album_name") + val albumName: String, + + @ColumnInfo(name = "artist_id") + val artistId: Long, + + @ColumnInfo(name = "artist_name") + val artistName: String, + + val composer: String?, + + @ColumnInfo(name = "album_artist") + val albumArtist: String?, +) From afa829bf335967381d0d73e2ebbd61431e901d38 Mon Sep 17 00:00:00 2001 From: Teodor Grigor Date: Thu, 15 Feb 2024 21:51:04 +0200 Subject: [PATCH 4/4] Prepare for release 1.0.0-alpha02 --- .github/workflows/publish-docs.yml | 4 +-- README.md | 4 +-- build.gradle.kts | 2 +- docs/index.md | 2 +- docs/reference.md | 38 +++++++----------------- docs/releases.md | 33 +++++++++++++++----- docs/releases/changelog/1.0.0-alpha02.md | 13 ++++++++ docs/releases/implementation.md | 30 +++++++++++++------ mkdocs.yml | 2 +- 9 files changed, 76 insertions(+), 52 deletions(-) create mode 100644 docs/releases/changelog/1.0.0-alpha02.md diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index f41db6e..4180032 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -64,8 +64,8 @@ jobs: - name: Relocate API References run: | - mkdir -p build/docs/${{ env.REPOSITORY }}/reference - cp -r build/dokka/htmlMultiModule/* build/docs/${{ env.REPOSITORY }}/reference + mkdir -p build/docs/${{ env.REPOSITORY }}/html + cp -r build/dokka/htmlMultiModule/* build/docs/${{ env.REPOSITORY }}/html - id: publish-docs name: Deploy Documentation diff --git a/README.md b/README.md index 17fd991..b2139d2 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Overview [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) -[![Maven Central](https://img.shields.io/maven-central/v/dev.teogor.stitch/bom.svg?label=Maven%20Central)](https://central.sonatype.com/search?q=g%3Adev.teogor.stitch+a%3Aapi&smo=true) +[![Maven Central](https://img.shields.io/maven-central/v/dev.teogor.stitch/common.svg?label=Maven%20Central)](https://central.sonatype.com/search?q=g%3Adev.teogor.stitch+a%3Acommon&smo=true) [![API](https://img.shields.io/badge/API-24%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=24) [![Profile](https://source.teogor.dev/badges/teogor-github.svg)](https://github.com/teogor) [![Portfolio](https://source.teogor.dev/badges/teogor-dev.svg)](https://source.teogor.dev/stitch) @@ -39,8 +39,6 @@ Tired of writing repetitive Room boilerplate code? Stitch, your friendly Kotlin * **Coroutine-friendly Operations:** Stitch supports asynchronous data access using coroutines, ensuring a responsive and efficient user experience. * **Efficient KSP Integration:** Leverages Kotlin Symbol Processing for accurate and optimized code generation based on your project's specific setup. - - ## Documentation and Community: * **Website:** [https://source.teogor.dev/stitch](https://source.teogor.dev/stitch) diff --git a/build.gradle.kts b/build.gradle.kts index 7a44d44..0964766 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -47,7 +47,7 @@ winds { url = "https://source.teogor.dev/stitch" version = createVersion(1, 0, 0) { - alphaRelease(1) + alphaRelease(2) } inceptionYear = 2024 diff --git a/docs/index.md b/docs/index.md index f6a2c10..7381e26 100644 --- a/docs/index.md +++ b/docs/index.md @@ -2,7 +2,7 @@ ## Overview [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) -[![Maven Central](https://img.shields.io/maven-central/v/dev.teogor.stitch/bom.svg?label=Maven%20Central)](https://central.sonatype.com/search?q=g%3Adev.teogor.stitch+a%3Aapi&smo=true) +[![Maven Central](https://img.shields.io/maven-central/v/dev.teogor.stitch/common.svg?label=Maven%20Central)](https://central.sonatype.com/search?q=g%3Adev.teogor.stitch+a%3Acommon&smo=true) [![API](https://img.shields.io/badge/API-24%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=24) [![Profile](https://source.teogor.dev/badges/teogor-github.svg)](https://github.com/teogor) [![Portfolio](https://source.teogor.dev/badges/teogor-dev.svg)](https://source.teogor.dev) diff --git a/docs/reference.md b/docs/reference.md index 0b728cc..34d351c 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -1,10 +1,9 @@ ## Reference Welcome to the comprehensive API documentation for our project, meticulously crafted to empower you -to -effectively utilize its capabilities. This guide provides detailed information about the project's -structure, API, and usage, enabling you to navigate the project with ease and unlock its full -potential. +to effectively utilize its capabilities. This guide provides detailed information about the +project's structure, API, and usage, enabling you to navigate the project with ease and unlock its +full potential. ### Project Overview @@ -12,31 +11,14 @@ Our project encompasses a suite of modules, each designed to address specific fu enhance the overall developer experience. To delve into the intricacies of each module, refer to the dedicated documentation pages: -**Dive into the essential components of our project:** +### API Reference -- **[Stitch](../reference):** Explore the core functionalities that weave everything together, - enabling seamless code generation, data binding, and more. Discover how Stitch streamlines your - development process and empowers you to focus on your app's core logic. - -- **[Codegen](../reference/codegen):** Delve into the heart of code generation, where magic happens - behind the scenes. Learn about the mechanisms that transform your annotations and models into - efficient, type-safe code, saving you time and effort. - -- **[Common](../reference/common):** Explore the shared utilities and components that form the - backbone of our project. Discover reusable classes, extensions, and tools that ensure consistency - and maintainability across different modules. - -- **[Gradle Plugin](../reference/gradle-plugin):** Empower your development with the Kotlin Symbol - Processing (KSP) Plugin. Learn how to seamlessly integrate Stitch into your Gradle build process, - enabling powerful code generation features at build time. - -- **[Gradle Plugin API](../reference/gradle-plugin-api):** Uncover the intricacies of custom Gradle - plugin development. Get insights into extending Stitch's capabilities and tailoring it to your - specific project needs through a flexible API. - -- **[KSP Processor](../reference/ksp):** Dive into the heart of code analysis and transformation. - Explore how Stitch utilizes KSP to examine your code, generate tailored components, and weave them - seamlessly into your project. +* [`dev.teogor.stitch`](../html/){:target="_blank"} +* [`dev.teogor.stitch:codegen`](../html/codegen){:target="_blank"} +* [`dev.teogor.stitch:common`](../html/common){:target="_blank"} +* [`dev.teogor.stitch:gradle-plugin`](../html/gradle-plugin){:target="_blank"} +* [`dev.teogor.stitch:gradle-plugin-api`](../html/gradle-plugi-api){:target="_blank"} +* [`dev.teogor.stitch:ksp`](../html/ksp){:target="_blank"} ### Contributions and Support diff --git a/docs/releases.md b/docs/releases.md index dd7563f..c06b9a6 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -8,16 +8,18 @@ Stitch handles the Room boilerplate, including automatic generation of repositor ### API Reference -* [`dev.teogor.stitch`](../reference/gradle-plugin) -* [`dev.teogor.stitch:codegen`](../reference/codegen) -* [`dev.teogor.stitch:common`](../reference/common) -* [`dev.teogor.stitch:gradle-plugin-api`](../reference/gradle-plugin-api) -* [`dev.teogor.stitch:ksp`](../reference/ksp) +* [`dev.teogor.stitch`](../html/){:target="_blank"} +* [`dev.teogor.stitch:codegen`](../html/codegen){:target="_blank"} +* [`dev.teogor.stitch:common`](../html/common){:target="_blank"} +* [`dev.teogor.stitch:gradle-plugin`](../html/gradle-plugin){:target="_blank"} +* [`dev.teogor.stitch:gradle-plugin-api`](../html/gradle-plugi-api){:target="_blank"} +* [`dev.teogor.stitch:ksp`](../html/ksp){:target="_blank"} ### Release | Latest Update | Stable Release | Beta Release | Alpha Release | |:-----------------:|:--------------:|:------------:|:-------------:| +| February 15, 2024 | - | - | 1.0.0-alpha02 | | February 06, 2024 | - | - | 1.0.0-alpha01 | ### Declaring dependencies @@ -31,7 +33,7 @@ Add the dependencies for the artifacts you need in the `build.gradle` file for y ```kotlin plugins { - id("dev.teogor.stitch") version "1.0.0-alpha01" + id("dev.teogor.stitch") version "1.0.0-alpha02" } ``` @@ -39,7 +41,7 @@ Add the dependencies for the artifacts you need in the `build.gradle` file for y ```groovy plugins { - id 'dev.teogor.stitch' version '1.0.0-alpha01' + id 'dev.teogor.stitch' version '1.0.0-alpha02' } ``` @@ -54,6 +56,23 @@ existing issue by clicking the star button. ### Version 1.0.0 +#### Version 1.0.0-alpha02 + +February 15, 2024 + +`dev.teogor.stitch:stitch-*:1.0.0-alpha02` is +released. [Version 1.0.0-alpha02 contains these commits.](https://github.com/teogor/stitch/compare/1.0.0-alpha01...1.0.0-alpha02) + +**Enhancement** + +* Introduce Fine-grained Control over Generated Operations ([#8](https://github.com/teogor/stitch/pull/8)) by [@teogor](https://github.com/teogor) +* Add `:core:database` package for data management ([#5](https://github.com/teogor/stitch/pull/5)) by [@teogor](https://github.com/teogor) + +**Bug Fixes** + +* Implement `ExplicitEntities` Annotation for Enhanced DAO and Entity Management ([#10](https://github.com/teogor/stitch/pull/10)) by [@teogor](https://github.com/teogor) +* Prevent unintended null defaults in Stitch code generation ([#6](https://github.com/teogor/stitch/pull/6)) by [@teogor](https://github.com/teogor) + #### Version 1.0.0-alpha01 February 06, 2024 diff --git a/docs/releases/changelog/1.0.0-alpha02.md b/docs/releases/changelog/1.0.0-alpha02.md new file mode 100644 index 0000000..f6a350e --- /dev/null +++ b/docs/releases/changelog/1.0.0-alpha02.md @@ -0,0 +1,13 @@ +[//]: # (This file was automatically generated - do not edit) + +# Version 1.0.0-alpha02 + +## Latest SDK versions + +| Status | Service or Product | Gradle dependency | Latest version | +|:------:|:---------------------------------------------------------:|:-----------------------------------:|:--------------:| +| ๐Ÿงช | [Stitch Codegen](../../../reference/codegen) | dev.teogor.stitch:codegen | 1.0.0-alpha02 | +| ๐Ÿงช | [Stitch Common](../../../reference/common) | dev.teogor.stitch:common | 1.0.0-alpha02 | +| ๐Ÿงช | [Stitch Plugin API](../../../reference/gradle-plugin-api) | dev.teogor.stitch:gradle-plugin-api | 1.0.0-alpha02 | +| ๐Ÿงช | [Stitch KSP Processor](../../../reference/ksp) | dev.teogor.stitch:ksp | 1.0.0-alpha02 | +| ๐Ÿงช | [Stitch Gradle Plugin](../../../reference/gradle-plugin) | dev.teogor.stitch | 1.0.0-alpha02 | diff --git a/docs/releases/implementation.md b/docs/releases/implementation.md index 3ce0214..8af043a 100644 --- a/docs/releases/implementation.md +++ b/docs/releases/implementation.md @@ -4,7 +4,7 @@ ### Latest Version -The latest release is [`1.0.0-alpha01`](../releases.md) +The latest release is [`1.0.0-alpha02`](../releases.md) ### Plugin Releases @@ -12,6 +12,7 @@ Here's a summary of the latest versions: | Version | Release Notes | Release Date | |:-------------:|:------------------------------------------:|:------------:| +| 1.0.0-alpha02 | [changelog ๐Ÿ”—](changelog/1.0.0-alpha02.md) | 15 Feb 2024 | | 1.0.0-alpha01 | [changelog ๐Ÿ”—](changelog/1.0.0-alpha01.md) | 06 Feb 2024 | ### Using Version Catalog @@ -25,14 +26,15 @@ TOML format. ```toml title="gradle/libs.versions.toml" [versions] - stitch = "1.0.0-alpha01" + teogor-stitch = "1.0.0-alpha02" [libraries] - stitch-common = { id = "dev.teogor.stitch", name = "common", version.ref = "stitch" } - stitch-ksp = { id = "dev.teogor.stitch", name = "ksp", version.ref = "stitch" } + teogor-stitch-codegen = { module = "dev.teogor.stitch:codegen", version.ref = "teogor-stitch" } + teogor-stitch-common = { module = "dev.teogor.stitch:common", version.ref = "teogor-stitch" } + teogor-stitch-ksp = { module = "dev.teogor.stitch:ksp", version.ref = "teogor-stitch" } [plugins] - stitch = { id = "dev.teogor.stitch", version.ref = "stitch" } + teogor-stitch = { id = "dev.teogor.stitch", version.ref = "teogor-stitch" } ``` #### Dependencies Implementation @@ -40,19 +42,29 @@ TOML format. === "Kotlin" ```kotlin title="build.gradle.kts" + plugins { + // Stitch Plugin + alias(libs.plugins.teogor.stitch) + } + dependencies { // Stitch Libraries - implementation(libs.stitch.common) - ksp(libs.stitch.ksp) + implementation(libs.teogor.stitch.common) + ksp(libs.teogor.stitch.ksp) } ``` === "Groovy" ```groovy title="build.gradle" + plugins { + // Stitch Plugin + alias libs.plugins.teogor.stitch + } + dependencies { // Stitch Libraries - implementation(libs.stitch.common) - ksp(libs.stitch.ksp) + implementation libs.teogor.stitch.common + ksp libs.teogor.stitch.ksp } ``` diff --git a/mkdocs.yml b/mkdocs.yml index 71249a1..b2f8a57 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -3,7 +3,7 @@ site_description: Stitch handles the Room boilerplate, including automatic gener site_author: Teodor Grigor (teogor) site_dir: build/docs/stitch site_url: https://github.com/teogor/stitch -edit_uri: raw/main/docs/ +edit_uri: edit/main/docs/ docs_dir: docs