Skip to content

Commit

Permalink
Add detekt and ktlint to multi-host livestream app
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohsen Mirhoseini committed Nov 10, 2022
1 parent bcfd3e0 commit f3934fa
Show file tree
Hide file tree
Showing 19 changed files with 224 additions and 52 deletions.
25 changes: 25 additions & 0 deletions multi_host_livestream/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# SOURCE: https://github.com/JetBrains/kotlin-playground/blob/master/.editorconfig
root = true


[*]
indent_style = space
indent_size = 4

max_line_length = 150

end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

ij_continuation_indent_size = 4
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = true
ij_kotlin_spaces_around_equality_operators = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
10 changes: 6 additions & 4 deletions multi_host_livestream/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ output.json

# IntelliJ
*.iml
.idea/
.idea/*
!.idea/codeStyles/
!.idea/detekt.xml
misc.xml
deploymentTargetDropDown.xml
render.experimental.xml

# Keystore files
*.jks
*.keystore
# *.jks
# *.keystore

# Google Services (e.g. APIs or Firebase)
google-services.json
# google-services.json

# Android Profiling
*.hprof
Expand Down
140 changes: 140 additions & 0 deletions multi_host_livestream/.idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions multi_host_livestream/.idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions multi_host_livestream/.idea/detekt.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions multi_host_livestream/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("org.jlleitschuh.gradle.ktlint")
id("io.gitlab.arturbosch.detekt")
}

android {
Expand Down Expand Up @@ -36,14 +38,28 @@ android {
}

kotlinOptions {
allWarningsAsErrors = true
jvmTarget = JavaVersion.VERSION_1_8.toString()
}

lint {
abortOnError = true
ignoreWarnings = false
warningsAsErrors = true
}

buildFeatures {
viewBinding = true
}
}

detekt {
allRules = true
config = files("$rootDir/config/detekt/detekt-config.yml")
baseline = file("detekt-baseline.xml")
buildUponDefaultConfig = true
}

dependencies {
implementation("androidx.appcompat:appcompat:1.5.1")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
Expand Down
11 changes: 1 addition & 10 deletions multi_host_livestream/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

<application
android:name=".ExampleApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
Expand All @@ -18,15 +15,9 @@
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<!-- this is required by Firework Android SDK v2 to get advertising_id from Android Ad SDK -->
<meta-data
android:name="com.google.android.gms.ads.AD_MANAGER_APP"
android:value="true" />
</application>

</manifest>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class ExampleApplication : Application() {
.clientId(FW_CLIENT_ID) // Client OAUTH Id
.userId("example app user ID") // User Id in your eco-system
.imageLoader(GlideImageLoaderFactory.createInstance()) // glide, picasso, or your implementation
.addLivestreamPlayerInitializer(MultihostSupportLivestreamPlayerInitializer()) // Single-Host Livestream and Multi-Host Livestream can be used together, and single-host can be used as a fallback for missing multi-host
// Single-Host and Multi-Host Livestreams can be used together, and single-host will be used as a fallback if multi-host is missing
.addLivestreamPlayerInitializer(MultihostSupportLivestreamPlayerInitializer())
.build()

// initialize Firework Android SDK v2
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

2 changes: 1 addition & 1 deletion multi_host_livestream/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">Firework Multi-Host Livestream Example</string>
<string name="app_name">FW Multi-Host Livestream</string>
</resources>
13 changes: 0 additions & 13 deletions multi_host_livestream/app/src/main/res/xml/backup_rules.xml

This file was deleted.

This file was deleted.

2 changes: 2 additions & 0 deletions multi_host_livestream/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ plugins {
id("com.android.application") version "7.3.1" apply false
id("com.android.library") version "7.3.1" apply false
id("org.jetbrains.kotlin.android") version "1.6.10" apply false
id("org.jlleitschuh.gradle.ktlint") version "10.3.0" apply false
id("io.gitlab.arturbosch.detekt") version "1.20.0" apply false
}

task<Delete>("clean") {
Expand Down
13 changes: 13 additions & 0 deletions multi_host_livestream/config/detekt/detekt-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
style:
MaxLineLength:
maxLineLength: 150

ReturnCount:
max: 5

complexity:
LongParameterList:
constructorThreshold: 15

TooManyFunctions:
ignorePrivate: true

0 comments on commit f3934fa

Please sign in to comment.