Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
Misc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
arkon committed Sep 15, 2023
1 parent 1aa6775 commit 29e3589
Show file tree
Hide file tree
Showing 71 changed files with 161 additions and 209 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
- name: Checkout pull request
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

Expand All @@ -34,4 +34,4 @@ jobs:
- name: Build project
uses: gradle/gradle-command-action@v2
with:
arguments: :server:shadowJar
arguments: :inspector:shadowJar
4 changes: 2 additions & 2 deletions .github/workflows/build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- name: Clone repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
Expand All @@ -34,4 +34,4 @@ jobs:
- name: Build project
uses: gradle/gradle-command-action@v2
with:
arguments: :server:shadowJar
arguments: :inspector:shadowJar
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- name: Checkout ${{ github.ref }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

Expand All @@ -36,7 +36,7 @@ jobs:
- name: Build project
uses: gradle/gradle-command-action@v2
with:
arguments: :server:shadowJar
arguments: :inspector:shadowJar

- name: Upload Release
uses: xresloader/upload-to-github-release@v1
Expand Down
8 changes: 0 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,3 @@ local.properties
# Ignore Gradle build output directory
build

server/src/main/resources/webUI
server/tmp/
server/tachiserver-data/

# bundle asset downlaods
OpenJDK*.zip
electron-*.zip
rcedit-*
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ package xyz.nulldev.ts.config
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import ch.qos.logback.classic.Level
import com.typesafe.config.Config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ package xyz.nulldev.ts.config
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import com.typesafe.config.Config

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ package xyz.nulldev.ts.config
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import ch.qos.logback.classic.Level
import mu.KotlinLogging
Expand Down
3 changes: 2 additions & 1 deletion AndroidCompat/src/main/java/android/widget/EditText.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

public class EditText {
public EditText(android.content.Context context) { throw new RuntimeException("Stub!"); }
Expand Down
3 changes: 2 additions & 1 deletion AndroidCompat/src/main/java/android/widget/Toast.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

public class Toast {
public static final int LENGTH_LONG = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import android.content.Context;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import android.content.Context;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import android.annotation.NonNull;
import android.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import android.content.Context;
import android.text.TextUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import android.content.Context;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import android.content.Context;
import android.content.SharedPreferences;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import android.content.Context;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import android.content.Context;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import android.content.Context;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ package xyz.nulldev.androidcompat.io.sharedprefs
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import android.content.SharedPreferences
import com.russhwolf.settings.ExperimentalSettingsApi
Expand All @@ -23,7 +24,7 @@ import java.util.prefs.Preferences

@OptIn(ExperimentalSettingsImplementation::class, ExperimentalSerializationApi::class, ExperimentalSettingsApi::class)
class JavaSharedPreferences(key: String) : SharedPreferences {
private val javaPreferences = Preferences.userRoot().node("suwayomi/tachidesk/$key")
private val javaPreferences = Preferences.userRoot().node("inspector/$key")
private val preferences = JvmPreferencesSettings(javaPreferences)
private val listeners = mutableMapOf<SharedPreferences.OnSharedPreferenceChangeListener, PreferenceChangeListener>()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import com.ibm.icu.text.DisplayContext;
import com.ibm.icu.util.Currency;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import com.ibm.icu.text.DateFormatSymbols;
import com.ibm.icu.text.DisplayContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import com.ibm.icu.text.DateFormat;
import com.ibm.icu.util.ULocale;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import com.ibm.icu.util.ULocale;

Expand Down
10 changes: 4 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ plugins {
}

allprojects {
group = "suwayomi"

group = "tachiyomi"
version = "1.0"

repositories {
Expand All @@ -24,9 +23,9 @@ allprojects {
}

val projects = listOf(
project(":AndroidCompat"),
project(":AndroidCompat:Config"),
project(":server")
project(":AndroidCompat"),
project(":AndroidCompat:Config"),
project(":inspector")
)

configure(projects) {
Expand All @@ -47,7 +46,6 @@ configure(projects) {
// Kotlin
implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))
testImplementation(kotlin("test"))

// coroutines
val coroutinesVersion = "1.6.4"
Expand Down
22 changes: 9 additions & 13 deletions server/build.gradle.kts → inspector/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ dependencies {
implementation("com.squareup.okhttp3:okhttp-dnsoverhttps:$okhttpVersion")
implementation("com.squareup.okio:okio:3.3.0")


// dependencies of Tachiyomi extensions, some are duplicate, keeping it here for reference
implementation("com.github.inorichi.injekt:injekt-core:65b0440")
implementation("com.squareup.okhttp3:okhttp:$okhttpVersion")
Expand All @@ -35,12 +34,9 @@ dependencies {

// uncomment to test extensions directly
// implementation(fileTree("lib/"))

// Testing
testImplementation(kotlin("test-junit5"))
}

val MainClass = "suwayomi.tachidesk.MainKt"
val MainClass = "inspector.MainKt"
application {
mainClass.set(MainClass)
}
Expand Down Expand Up @@ -75,7 +71,7 @@ val String.wrapped get() = """"$this""""

buildConfig {
className("BuildConfig")
packageName("suwayomi.server")
packageName("inspector")

useKotlinOutput()

Expand All @@ -88,13 +84,13 @@ tasks {
shadowJar {
manifest {
attributes(
mapOf(
"Main-Class" to MainClass,
"Implementation-Title" to rootProject.name,
"Implementation-Vendor" to "The Tachiyomi Open Source Project",
"Specification-Version" to inspectorVersion,
"Implementation-Version" to inspectorRevision
)
mapOf(
"Main-Class" to MainClass,
"Implementation-Title" to rootProject.name,
"Implementation-Vendor" to "The Tachiyomi Open Source Project",
"Specification-Version" to inspectorVersion,
"Implementation-Version" to inspectorRevision
)
)
}
archiveBaseName.set(rootProject.name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ package eu.kanade.tachiyomi
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import android.app.Application
import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,26 @@ package eu.kanade.tachiyomi
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import android.app.Application
import eu.kanade.tachiyomi.network.JavaScriptEngine
import eu.kanade.tachiyomi.network.NetworkHelper
import kotlinx.serialization.json.Json
import rx.Observable
import rx.schedulers.Schedulers
import uy.kohesive.injekt.api.InjektModule
import uy.kohesive.injekt.api.InjektRegistrar
import uy.kohesive.injekt.api.addSingleton
import uy.kohesive.injekt.api.addSingletonFactory
import uy.kohesive.injekt.api.get

class AppModule(val app: Application) : InjektModule {

override fun InjektRegistrar.registerInjectables() {

addSingleton(app)

addSingletonFactory { NetworkHelper(app) }
addSingletonFactory { JavaScriptEngine(app) }

addSingletonFactory { Json { ignoreUnknownKeys = true } }

// Asynchronously init expensive components for a faster cold start
rxAsync { get<NetworkHelper>() }
}

private fun rxAsync(block: () -> Unit) {
Observable.fromCallable { block() }.subscribeOn(Schedulers.computation()).subscribe()
}
}
8 changes: 8 additions & 0 deletions inspector/src/main/kotlin/eu/kanade/tachiyomi/BuildConfig.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package eu.kanade.tachiyomi

class BuildConfig {
companion object {
const val VERSION_NAME = inspector.BuildConfig.NAME
val VERSION_CODE = inspector.BuildConfig.REVISION.trimStart('r').toInt()
}
}
Loading

0 comments on commit 29e3589

Please sign in to comment.