Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move to prod backend. #235

Merged
merged 3 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ kotlin {
kotlin.srcDir("src/commonFdroidMain/kotlin")
}
}
kotlin.srcDir(if (isDebugTaskRequested()) "src/commonMain/debug/kotlin" else "src/commonMain/release/kotlin")
kotlin.srcDir("src/${config.folder}/kotlin")
}
iosMain.dependencies {
Expand Down Expand Up @@ -172,9 +173,12 @@ android {
buildTypes {
getByName("debug") {
applicationIdSuffix = ".debug"
resValue("string", "run_v2_domain", "run.test.ooni.org")
}
getByName("release") {
isMinifyEnabled = false
resValue("string", "run_v2_domain", "run.ooni.org")
signingConfig = signingConfigs.getByName("debug")
}
}
buildFeatures {
Expand Down Expand Up @@ -258,6 +262,10 @@ fun isFdroidTaskRequested(): Boolean {
return gradle.startParameter.taskRequests.flatMap { it.args }.any { it.contains("Fdroid") }
}

fun isDebugTaskRequested(): Boolean {
return gradle.startParameter.taskRequests.flatMap { it.args }.any { it.contains("Debug") }
}

tasks.register("copyBrandingToCommonResources") {
doLast {
val projectDir = project.projectDir.absolutePath
Expand Down Expand Up @@ -397,7 +405,7 @@ fun copyRecursive(
}

tasks.register("runDebug", Exec::class) {
dependsOn("clean", "uninstallDebug", "installDebug")
dependsOn("clean", "uninstallFullDebug", "installFullDebug")
commandLine(
"adb",
"shell",
Expand Down
2 changes: 1 addition & 1 deletion composeApp/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<action android:name="${applicationId}.nettest" />

<data
android:host="run.test.ooni.org"
android:host="@string/run_v2_domain"
android:pathPrefix="/v2"
android:scheme="https" />
</intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.ooni.probe.config


interface OrganizationConfigInterface {
val baseSoftwareName: String

val ooniApiBaseUrl: String
get() = "https://api.dev.ooni.io"

val ooniRunDomain: String
get() = "run.test.ooni.org"

val ooniRunDashboardUrl: String
get() = "https://run.test.ooni.org"

val testDisplayMode: TestDisplayMode

val autorunTaskId: String

val onboardingImages: OnboardingImages

val updateDescriptorTaskId: String
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ data class OONIRunDescriptor(
@SerialName("description") val description: String,
@SerialName("author") val author: String,
@SerialName("nettests") val netTests: List<OONINetTest>,
@SerialName("name_intl") val nameIntl: Map<String, String>,
@SerialName("short_description_intl") val shortDescriptionIntl: Map<String, String>,
@SerialName("description_intl") val descriptionIntl: Map<String, String>,
@SerialName("icon") val icon: String,
@SerialName("color") val color: String,
@SerialName("name_intl") val nameIntl: Map<String, String>?,
@SerialName("short_description_intl") val shortDescriptionIntl: Map<String, String>?,
@SerialName("description_intl") val descriptionIntl: Map<String, String>?,
@SerialName("icon") val icon: String?,
@SerialName("color") val color: String?,
@SerialName("animation") val animation: String? = null,
@SerialName("expiration_date") val expirationDate: Instant,
@SerialName("date_created") val dateCreated: Instant,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,6 @@ package org.ooni.probe.config

import org.jetbrains.compose.resources.DrawableResource

interface OrganizationConfigInterface {
val baseSoftwareName: String

val ooniApiBaseUrl: String
get() = "https://api.dev.ooni.io"

val ooniRunDomain: String
get() = "run.test.ooni.org"

val ooniRunDashboardUrl: String
get() = "https://run.test.ooni.org"

val testDisplayMode: TestDisplayMode

val autorunTaskId: String

val onboardingImages: OnboardingImages

val updateDescriptorTaskId: String
}

data class OnboardingImages(
val image1: DrawableResource,
val image2: DrawableResource,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.ooni.probe.config

interface OrganizationConfigInterface {
val baseSoftwareName: String

val ooniApiBaseUrl: String
get() = "https://api.ooni.org"

val ooniRunDomain: String
get() = "run.ooni.org"

val ooniRunDashboardUrl: String
get() = "https://run.ooni.org"

val testDisplayMode: TestDisplayMode

val autorunTaskId: String

val onboardingImages: OnboardingImages

val updateDescriptorTaskId: String
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import ooniprobe.composeapp.generated.resources.onboarding

object OrganizationConfig : OrganizationConfigInterface {
override val baseSoftwareName = "news-media-scan"
override val ooniApiBaseUrl = "https://api.prod.ooni.io"
override val ooniRunDashboardUrl = "https://run-v2.ooni.org"
override val testDisplayMode = TestDisplayMode.WebsitesOnly
override val autorunTaskId = "org.dw.probe.autorun-task"
override val updateDescriptorTaskId = "org.dw.probe.update-descriptor-task"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import ooniprobe.composeapp.generated.resources.onboarding3

object OrganizationConfig : OrganizationConfigInterface {
override val baseSoftwareName = "ooniprobe"
override val ooniApiBaseUrl = "https://api.dev.ooni.io"
override val testDisplayMode = TestDisplayMode.Regular
override val autorunTaskId = "org.ooni.probe.autorun-task"
override val updateDescriptorTaskId = "org.ooni.probe.update-descriptor-task"
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ kotlin-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version =

# UI
android-activity = { module = "androidx.activity:activity-ktx", version = "1.9.3" }
android-work = { module = "androidx.work:work-runtime-ktx", version = "2.9.1" }
android-work = { module = "androidx.work:work-runtime-ktx", version = "2.10.0" }

lifecycle-viewmodel-compose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose", version = "2.8.0" }
navigation = { module = "org.jetbrains.androidx.navigation:navigation-compose", version = "2.7.0-alpha07" }
Expand Down Expand Up @@ -79,7 +79,7 @@ android-orchestrator = { module = "androidx.test:orchestrator", version = "1.5.1
androidx-junit-ktx = { group = "androidx.test.ext", name = "junit-ktx", version.ref = "junitKtx" }
android-test-runner = { module = "androidx.test:runner", version = "1.6.2" }
android-test-rules = { module = "androidx.test:rules", version = "1.6.1" }
androidx-compose-test-android = { module = "androidx.compose.ui:ui-test-junit4-android", version = "1.7.4" }
androidx-compose-test-android = { module = "androidx.compose.ui:ui-test-junit4-android", version = "1.7.5" }
androidx-espresso-web = { module = "androidx.test.espresso:espresso-web", version = "3.6.1" }

[bundles]
Expand Down