Skip to content

Commit

Permalink
fix: random ahh circular dependency when pushing to jitpack
Browse files Browse the repository at this point in the history
  • Loading branch information
rhenwinch committed Feb 11, 2024
1 parent 64d944f commit d31c10d
Showing 16 changed files with 99 additions and 122 deletions.
4 changes: 0 additions & 4 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -56,10 +56,6 @@ gradlePlugin {
id = "flixclusive.destinations"
implementationClass = "DestinationsConventionPlugin"
}
register("flixclusiveExtractor") {
id = "flixclusive.extractor"
implementationClass = "ExtractorConventionPlugin"
}
register("flixclusiveProvider") {
id = "flixclusive.provider"
implementationClass = "ProviderConventionPlugin"

This file was deleted.

39 changes: 8 additions & 31 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -17,7 +17,14 @@ plugins {
alias(libs.plugins.ksp) apply false
alias(libs.plugins.room) apply false
id("com.osacky.doctor") version "0.9.1"
id("maven-publish")
}

subprojects {
val moduleGroup = if (group.toString().contains(rootProject.name, true).not()) {
path.substringBeforeLast(":").replace(":", ".")
} else ""

group = "$group$moduleGroup"
}

// Generate a mf FAT AHH JAR!
@@ -66,34 +73,4 @@ tasks.register<Jar>("generateStubsJar") {
}
}
}
}



subprojects {
apply(plugin = "maven-publish")

if (subprojects.size == 0) {
val publishingGroup = "com.github.rhenwinch"
this.group = this.group.toString().replace(rootProject.name, publishingGroup)

publishing {
repositories {
mavenLocal()

val token = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")

if (token != null) {
maven {
credentials {
username = "rhenwinch"
password = token
}
setUrl("https://maven.pkg.github.com/rhenwinch/flixclusive")
}
}
}
}
}

}
21 changes: 21 additions & 0 deletions core/util/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ plugins {
alias(libs.plugins.flixclusive.library)
alias(libs.plugins.flixclusive.hilt)
alias(libs.plugins.flixclusive.compose)
`maven-publish`
}

android {
@@ -17,4 +18,24 @@ dependencies {
implementation(libs.jsoup)
implementation(libs.okhttp.dnsoverhttps)
implementation(libs.retrofit)
}

afterEvaluate {
publishing {
repositories {
mavenLocal()

val token = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")

if (token != null) {
maven {
credentials {
username = "rhenwinch"
password = token
}
setUrl("https://maven.pkg.github.com/rhenwinch/Flixclusive")
}
}
}
}
}
1 change: 0 additions & 1 deletion extractor/base/.gitignore

This file was deleted.

15 changes: 0 additions & 15 deletions extractor/base/build.gradle.kts

This file was deleted.

2 changes: 1 addition & 1 deletion extractor/mixdrop/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
alias(libs.plugins.flixclusive.extractor)
alias(libs.plugins.flixclusive.provider)
}

android {
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ package com.flixclusive.extractor.mixdrop

import com.flixclusive.core.util.network.asJsoup
import com.flixclusive.core.util.network.request
import com.flixclusive.extractor.base.Extractor
import com.flixclusive.provider.base.extractor.Extractor
import com.flixclusive.extractor.mixdrop.util.Unpacker
import com.flixclusive.model.provider.SourceLink
import com.flixclusive.model.provider.Subtitle
2 changes: 1 addition & 1 deletion extractor/upcloud/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
alias(libs.plugins.flixclusive.extractor)
alias(libs.plugins.flixclusive.provider)
}

android {
Original file line number Diff line number Diff line change
@@ -7,14 +7,14 @@ import com.flixclusive.core.util.log.debugLog
import com.flixclusive.core.util.network.CryptographyUtil.decryptAes
import com.flixclusive.core.util.network.fromJson
import com.flixclusive.core.util.network.request
import com.flixclusive.extractor.base.Extractor
import com.flixclusive.extractor.upcloud.dto.DecryptedSource
import com.flixclusive.extractor.upcloud.dto.UpCloudEmbedData
import com.flixclusive.extractor.upcloud.dto.UpCloudEmbedData.Companion.toSubtitle
import com.flixclusive.extractor.upcloud.util.DecryptUtils.extractEmbedDecryptionDetails
import com.flixclusive.extractor.upcloud.util.DecryptUtils.getKeyStops
import com.flixclusive.model.provider.SourceLink
import com.flixclusive.model.provider.Subtitle
import com.flixclusive.provider.base.extractor.Extractor
import okhttp3.Headers
import okhttp3.OkHttpClient
import java.net.URL
1 change: 0 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -184,7 +184,6 @@ room = { id = "androidx.room", version.ref = "room" }
flixclusive-application = { id = "flixclusive.android.application", version = "unspecified" }
flixclusive-compose = { id = "flixclusive.compose", version = "unspecified" }
flixclusive-destinations = { id = "flixclusive.destinations", version = "unspecified" }
flixclusive-extractor = { id = "flixclusive.extractor", version = "unspecified" }
flixclusive-feature = { id = "flixclusive.feature", version = "unspecified" }
flixclusive-hilt = { id = "flixclusive.hilt", version = "unspecified" }
flixclusive-library = { id = "flixclusive.android.library", version = "unspecified" }
25 changes: 23 additions & 2 deletions provider/base/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
alias(libs.plugins.flixclusive.library)
alias(libs.plugins.flixclusive.testing)
`maven-publish`
}

android {
@@ -12,9 +13,29 @@ dependencies {
api(libs.jsoup)
api(libs.okhttp)
api(projects.core.util)
api(projects.extractor.base)
api(projects.model.provider)

implementation(libs.coroutines.test)
implementation(libs.junit)
implementation(libs.mockk)
}
}

afterEvaluate {
publishing {
repositories {
mavenLocal()

val token = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")

if (token != null) {
maven {
credentials {
username = "rhenwinch"
password = token
}
setUrl("https://maven.pkg.github.com/rhenwinch/Flixclusive")
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.flixclusive.provider.base

import com.flixclusive.core.util.film.FilmType
import com.flixclusive.extractor.base.Extractor
import com.flixclusive.model.provider.SourceLink
import com.flixclusive.model.provider.Subtitle
import com.flixclusive.provider.base.dto.FilmInfo
import com.flixclusive.provider.base.dto.SearchResults
import com.flixclusive.provider.base.extractor.Extractor
import okhttp3.OkHttpClient

/**
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
package com.flixclusive.extractor.base

import com.flixclusive.model.provider.SourceLink
import com.flixclusive.model.provider.Subtitle
import java.net.URL

/**
* An extractor class for providers that contains embeds.
*/
abstract class Extractor {
/**
* The name of the extractor.
*/
abstract val name: String

/**
* Alternate names for the extractor. Defaults to an empty list.
*/
open val alternateNames: List<String> = emptyList()

/**
* The host associated with the extractor.
*/
abstract val host: String

/**
* Extracts source links and subtitles from the provided URL.
* @param url The URL to extract from.
* @param mediaId The ID of the media.
* @param episodeId The ID of the episode.
* @param onLinkLoaded A callback function invoked when a source link is loaded.
* @param onSubtitleLoaded A callback function invoked when a subtitle is loaded.
*/
abstract suspend fun extract(
url: URL,
mediaId: String,
episodeId: String,
onLinkLoaded: (SourceLink) -> Unit,
onSubtitleLoaded: (Subtitle) -> Unit,
)
}
package com.flixclusive.provider.base.extractor

import com.flixclusive.model.provider.SourceLink
import com.flixclusive.model.provider.Subtitle
import java.net.URL

/**
* An extractor class for providers that contains embeds.
*/
abstract class Extractor {
/**
* The name of the extractor.
*/
abstract val name: String

/**
* Alternate names for the extractor. Defaults to an empty list.
*/
open val alternateNames: List<String> = emptyList()

/**
* The host associated with the extractor.
*/
abstract val host: String

/**
* Extracts source links and subtitles from the provided URL.
* @param url The URL to extract from.
* @param mediaId The ID of the media.
* @param episodeId The ID of the episode.
* @param onLinkLoaded A callback function invoked when a source link is loaded.
* @param onSubtitleLoaded A callback function invoked when a subtitle is loaded.
*/
abstract suspend fun extract(
url: URL,
mediaId: String,
episodeId: String,
onLinkLoaded: (SourceLink) -> Unit,
onSubtitleLoaded: (Subtitle) -> Unit,
)
}
Original file line number Diff line number Diff line change
@@ -4,14 +4,14 @@ import com.flixclusive.core.util.coroutines.mapAsync
import com.flixclusive.core.util.film.FilmType
import com.flixclusive.core.util.network.fromJson
import com.flixclusive.core.util.network.request
import com.flixclusive.extractor.base.Extractor
import com.flixclusive.extractor.upcloud.VidCloud
import com.flixclusive.model.provider.SourceLink
import com.flixclusive.model.provider.Subtitle
import com.flixclusive.provider.base.Provider
import com.flixclusive.provider.base.dto.FilmInfo
import com.flixclusive.provider.base.dto.SearchResultItem
import com.flixclusive.provider.base.dto.SearchResults
import com.flixclusive.provider.base.extractor.Extractor
import com.flixclusive.provider.base.util.TvShowCacheData
import com.flixclusive.provider.base.util.replaceWhitespaces
import com.flixclusive.provider.flixhq.dto.FlixHQInitialSourceData
1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -74,7 +74,6 @@ include(":data:user")
include(":data:watch_history")
include(":data:watchlist")

include(":extractor:base")
include(":extractor:mixdrop")
include(":extractor:upcloud")

0 comments on commit d31c10d

Please sign in to comment.