Skip to content

Commit

Permalink
chore: cleanup project for development (AR-754) (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorhugods authored Jan 12, 2022
1 parent fd1d99b commit 5abd5f5
Show file tree
Hide file tree
Showing 671 changed files with 1,330 additions and 236 deletions.
101 changes: 101 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
root = true

[*]
charset = utf-8
end_of_line = lf
max_line_length = 100
indent_size = 4
indent_style = space
insert_final_newline = true
tab_width = 4
ij_continuation_indent_size = 8
ij_formatter_off_tag = @formatter:off
ij_formatter_on_tag = @formatter:on
ij_formatter_tags_enabled = false
ij_smart_tabs = false
ij_visual_guides = none
ij_wrap_on_typing = false

[{*.gradle.kts,*.kt,*.kts,*.main.kts,*.space.kts}]
max_line_length = 140
ij_kotlin_name_count_to_use_star_import = 999
ij_kotlin_name_count_to_use_star_import_for_members = 999
ij_java_class_count_to_use_import_on_demand = 999
ij_kotlin_align_in_columns_case_branch = false
ij_kotlin_align_multiline_binary_operation = false
ij_kotlin_align_multiline_extends_list = false
ij_kotlin_align_multiline_method_parentheses = false
ij_kotlin_align_multiline_parameters = true
ij_kotlin_align_multiline_parameters_in_calls = false
ij_kotlin_allow_trailing_comma = false
ij_kotlin_allow_trailing_comma_on_call_site = false
ij_kotlin_assignment_wrap = normal
ij_kotlin_blank_lines_after_class_header = 0
ij_kotlin_blank_lines_around_block_when_branches = 0
ij_kotlin_blank_lines_before_declaration_with_comment_or_annotation_on_separate_line = 1
ij_kotlin_block_comment_at_first_column = true
ij_kotlin_call_parameters_new_line_after_left_paren = true
ij_kotlin_call_parameters_right_paren_on_new_line = true
ij_kotlin_call_parameters_wrap = on_every_item
ij_kotlin_catch_on_new_line = false
ij_kotlin_class_annotation_wrap = split_into_lines
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
ij_kotlin_continuation_indent_for_chained_calls = false
ij_kotlin_continuation_indent_for_expression_bodies = false
ij_kotlin_continuation_indent_in_argument_lists = false
ij_kotlin_continuation_indent_in_elvis = false
ij_kotlin_continuation_indent_in_if_conditions = false
ij_kotlin_continuation_indent_in_parameter_lists = false
ij_kotlin_continuation_indent_in_supertype_lists = false
ij_kotlin_else_on_new_line = false
ij_kotlin_enum_constants_wrap = off
ij_kotlin_extends_list_wrap = normal
ij_kotlin_field_annotation_wrap = split_into_lines
ij_kotlin_finally_on_new_line = false
ij_kotlin_if_rparen_on_new_line = true
ij_kotlin_import_nested_classes = false
ij_kotlin_imports_layout = *, java.**, javax.**, kotlin.**, ^
ij_kotlin_packages_to_use_import_on_demand = ^
ij_kotlin_insert_whitespaces_in_simple_one_line_method = true
ij_kotlin_keep_blank_lines_before_right_brace = 2
ij_kotlin_keep_blank_lines_in_code = 2
ij_kotlin_keep_blank_lines_in_declarations = 2
ij_kotlin_keep_first_column_comment = true
ij_kotlin_keep_indents_on_empty_lines = false
ij_kotlin_keep_line_breaks = true
ij_kotlin_lbrace_on_next_line = false
ij_kotlin_line_comment_add_space = false
ij_kotlin_line_comment_at_first_column = true
ij_kotlin_method_annotation_wrap = split_into_lines
ij_kotlin_method_call_chain_wrap = normal
ij_kotlin_method_parameters_new_line_after_left_paren = true
ij_kotlin_method_parameters_right_paren_on_new_line = true
ij_kotlin_method_parameters_wrap = on_every_item
ij_kotlin_parameter_annotation_wrap = off
ij_kotlin_space_after_comma = true
ij_kotlin_space_after_extend_colon = true
ij_kotlin_space_after_type_colon = true
ij_kotlin_space_before_catch_parentheses = true
ij_kotlin_space_before_comma = false
ij_kotlin_space_before_extend_colon = true
ij_kotlin_space_before_for_parentheses = true
ij_kotlin_space_before_if_parentheses = true
ij_kotlin_space_before_lambda_arrow = true
ij_kotlin_space_before_type_colon = false
ij_kotlin_space_before_when_parentheses = true
ij_kotlin_space_before_while_parentheses = true
ij_kotlin_spaces_around_additive_operators = true
ij_kotlin_spaces_around_assignment_operators = true
ij_kotlin_spaces_around_equality_operators = true
ij_kotlin_spaces_around_function_type_arrow = true
ij_kotlin_spaces_around_logical_operators = true
ij_kotlin_spaces_around_multiplicative_operators = true
ij_kotlin_spaces_around_range = false
ij_kotlin_spaces_around_relational_operators = true
ij_kotlin_spaces_around_unary_operator = false
ij_kotlin_spaces_around_when_arrow = true
ij_kotlin_variable_annotation_wrap = off
ij_kotlin_while_on_new_line = false
ij_kotlin_wrap_elvis_expressions = 1
ij_kotlin_wrap_expression_body_functions = 1
ij_kotlin_wrap_first_method_in_call_chain = false
32 changes: 32 additions & 0 deletions .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Check Codestyle"

on:
pull_request:
types: [ opened, synchronize ] # Don't rerun on `edited` to save time

jobs:
gradle-run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive # Needed in order to fetch Kalium sources for building
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: gradle
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Run Detekt
run: |
./gradlew detektAll
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
45 changes: 45 additions & 0 deletions .github/workflows/generate-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 'Generate Changelog'

on:
push:
tags:
- 'v*'

jobs:
Changelog:
runs-on: ubuntu-latest

steps:
- name: 'Checkout Git repository with history for all branches and tags'
uses: actions/[email protected]
with:
fetch-depth: 0
submodules: recursive # Needed in order to fetch Kalium sources for building

- name: 'Set current Git tag'
run: echo "CURRENT_TAG=$(git tag --points-at ${{github.sha}})" >> "$GITHUB_ENV"

- name: 'Set previous Git tag'
run: echo "PREVIOUS_TAG=$(git describe --tags --abbrev=0 --exclude ${{env.CURRENT_TAG}})" >> "$GITHUB_ENV"

- name: 'Print environment variables'
run: |
echo -e "PREVIOUS_TAG = ${{env.PREVIOUS_TAG}}"
echo -e "CURRENT_TAG = ${{env.CURRENT_TAG}}"
echo -e "Node.js version = $(node --version)"
- name: 'Generate changelog'
run: |
echo "{}" > ./package.json
npx [email protected] -t ${{env.PREVIOUS_TAG}}...${{env.CURRENT_TAG}}
- name: 'Attach changelog to tag'
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{github.token}}
with:
tag_name: ${{env.CURRENT_TAG}}
name: ${{env.CURRENT_TAG}}
body_path: ./CHANGELOG.md
draft: false
prerelease: false
44 changes: 44 additions & 0 deletions .github/workflows/gradle-run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Run Tests"

on:
pull_request:
types: [ opened, synchronize ] # Don't rerun on `edited` to save time

jobs:
gradle-run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive # Needed in order to fetch Kalium sources for building
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: gradle
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Test with Gradle
run: ./gradlew runUnitTests
- name: Android Instrumentation Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
script: ./gradlew runAcceptanceTests
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action/[email protected]
if: always()
with:
files: |
**/build/test-results/testDebugUnitTest/**/*.xml
**/build/test-results/**/*.xml
**/build/outputs/androidTest-results/**/*.xml
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
3 changes: 2 additions & 1 deletion .github/workflows/semantic-commit-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CUSTOM_PR_LABEL: "Fix PR Title 🤦‍♂️"
CUSTOM_PR_LABEL: "Fix PR Title or Commit message️"
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive # Needed in order to fetch Kalium sources for building

- name: Set environment variables
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "kalium"]
path = kalium
url = https://github.com/wireapp/kalium.git
branch = develop
6 changes: 3 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ pipeline {
}

withGradle() {
sh './gradlew :app:uninstallAll'
sh './gradlew uninstallAll'
}

}
Expand Down Expand Up @@ -276,7 +276,7 @@ pipeline {
}

withGradle() {
sh './gradlew :app:bundle${flavor}${buildType}'
sh './gradlew bundle${flavor}${buildType}'
}
}
}
Expand Down Expand Up @@ -367,4 +367,4 @@ pipeline {
}

}
}
}
39 changes: 4 additions & 35 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,25 @@ android {
}
}

externalNativeBuild {
cmake {
version = AndroidNdk.cMakeVersion
}
ndkBuild {
ndkVersion = AndroidNdk.version
path(File("src/main/jni/Android.mk"))
}
}

sourceSets {
map { it.java.srcDir("src/${it.name}/kotlin") }
}

// This enables us to share some code between UI and Unit tests!
fun AndroidSourceSet.includeCommonTestSourceDir() = java {
srcDir("src/commonTest/kotlin")
}
sourceSets["test"].includeCommonTestSourceDir()
sourceSets["androidTest"].includeCommonTestSourceDir()

// Remove protobuf-java as dependencies, so we can get protobuf-lite
configurations.implementation.configure {
exclude(module = "protobuf-java")
}
}

dependencies {
implementation("com.wire.kalium:kalium-network")
implementation("com.wire.kalium:kalium-logic")

// Application dependencies
implementation(Libraries.Kotlin.stdLib)
Expand All @@ -70,33 +63,9 @@ dependencies {
implementation(Libraries.viewModelKtx)
implementation(Libraries.Koin.androidCore)
implementation(Libraries.Koin.viewModel)
// implementation(Libraries.Koin.workManager)
implementation(Libraries.Kotlin.coroutinesCore)
implementation(Libraries.Kotlin.coroutinesAndroid)
implementation(Libraries.pinEditText)
implementation(Libraries.viewPager2)
implementation(Libraries.paging)
implementation(Libraries.glide)
implementation(Libraries.fragment)
kapt(Libraries.glideCompiler)
implementation(Libraries.workManager)
implementation(Libraries.scarlet)
implementation(Libraries.scarletOkhttp)
implementation(Libraries.scarletLifecycle)
implementation(Libraries.scarletGson)

implementation(Libraries.messageProto)
implementation(Libraries.Crypto.cryptobox)

implementation(Libraries.Retrofit.core)
implementation(Libraries.Retrofit.gsonConverter)
implementation(Libraries.Retrofit.protoConverter)
implementation(Libraries.okHttpLogging)

kapt(Libraries.Room.sqlLiteJdbc)
implementation(Libraries.Room.runtime)
implementation(Libraries.Room.ktx)
kapt(Libraries.Room.compiler)

// Unit/Android tests dependencies
testImplementation(TestLibraries.androidCore)
Expand Down
39 changes: 2 additions & 37 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,51 +16,16 @@
android:theme="@style/AppTheme.Light">

<activity
android:name=".feature.launch.ui.LauncherActivity"
android:name=".LauncherActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.Launch">
android:theme="@style/AppTheme.Dark">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

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

<!-- TODO Theme shouldn't resolve to Dark one. -->
<activity
android:name=".feature.welcome.ui.WelcomeActivity"
android:theme="@style/AppTheme.Authentication" />

<activity
android:name=".feature.auth.registration.CreateAccountActivity"
android:theme="@style/AppTheme.Authentication"
android:windowSoftInputMode="adjustResize" />

<activity
android:name=".feature.auth.login.LoginActivity"
android:theme="@style/AppTheme.Authentication" />

<activity
android:name=".feature.conversation.list.MainActivity"
android:theme="@style/AppTheme.Dark" />

<activity
android:name=".feature.profile.ui.ProfileActivity"
android:theme="@style/AppTheme.Dark" />

<activity
android:name=".feature.auth.client.ui.DeviceLimitActivity"
android:theme="@style/AppTheme.Authentication" />

<activity
android:name=".feature.conversation.content.ui.ConversationActivity"
android:theme="@style/AppTheme.Conversation" />

<!-- <provider-->
<!-- android:name="androidx.work.impl.WorkManagerInitializer"-->
<!-- android:authorities="${applicationId}.workmanager-init"-->
<!-- tools:node="remove" />-->

</application>

</manifest>
Loading

0 comments on commit 5abd5f5

Please sign in to comment.