android trinity
1.0.0
這是啟動新的Android應用程序所需的許多腳手架代碼(帶有一些不錯的實用程序和準備好的源代碼)的小框架。
是的,Android Studio可能會為您創建一個項目,但是缺少零件,我總是將其添加到我創建的每個項目中。這個微小的框架(我想仍然腳手架代碼)旨在通過簡單而快速地使用基本構建塊創建一個Android項目來解決此問題。檢查下面的待辦事項部分以獲取有關演變和進度的更多信息。
自由。它使用標準工具,但以促進Android開發的方式組織。您可以重構或更改任何內容,但想法是具有強大的起點。所有的接線都是為您完成的,具有根據您的需求進行修改的靈活性。
Kotlin DSL在Gradle Build System Leve上。BaseActivity和BaseFragments 。UnitTest , AndroidTest , AcceptanceTest 。buildScr文件夾):compilation.gradle.ktsinfrastructure.gradle.ktsquality.gradle.ktsvariants.gradle.ktsDependencies.ktvariants.gradle.kts文件)DEBUGRELEASEDEVINTERNALPUBLICLiveData和ViewModel庫,因為一些工程師可能會在UI級別使用MVI,MVP等的其他方法。./gradlew runStaticAnalysis./gradlew runTestCoverage./gradlew runUnitTests./gradlew runAcceptanceTests./gradlew compileApp./gradlew runApp目前,由於我們處於早期階段,因此涉及幾個手動步驟。但是我們相信Sofware Evolution對嗎?因此,請繼續關注並檢查如何貢獻和待辦事項列表部分。
com.fernandocejas.sample默認情況下。 假設您想編寫測試(並且您應該始終進行),如前所述,有3個類別的班級,在這裡使用它們的用法示例:
UnitTest.kt :單位測試基類為您設置模擬(您僅使用@Mockk註釋) class FeatureFlagTest : UnitTest () {
@Mockk prival val yourMock
@Test
fun `given a feature flag, when it is activated, then executes given logic block` () {
val activeFlag = ActiveFeatureFlag ()
val fakeNavigator = mockk< Navigator >(relaxed = true )
activeFlag whenActivated {
fakeNavigator.doSomething()
fakeNavigator.navigateToActiveFeature()
fakeNavigator.doSomething()
}
verify(exactly = 1 ) { fakeNavigator.navigateToActiveFeature() }
verify(exactly = 2 ) { fakeNavigator.doSomething() }
}AndroidTest.kt :為您設置模擬的集成測試基類(僅使用@Mockk註釋)。當涉及的Android組件時,您可能會使用此類。它是由Robolectric支持的。 class YourTestClass : AndroidTest () {
@Mockk prival val yourMock
@Test
fun `given something, when something happens, then do something` () {
TODO ()
}AcceptanceTest.kt :UI測試基類哪個為您設置濃縮咖啡 class MainActivityTest : AcceptanceTest ( MainActivity : :class.java) {
@Test
fun checkToolBarTest () {
onView(withId( R .id.toolbar)).check(matches(isDisplayed()))
}
}Android-Trinity包括一個簡單的離線功能標誌框架,並在編譯時生成非常簡單的API。如果您想要更多信息,請參閱引入的拉請請求。 (Todo:添加更多文檔)
其用法的示例:
Flag . Hello whenActivated { displayGreeting( R .string.hello) }quality.gradle.kts文件中找到。quality.gradle.kts文件中找到。 ./gradlew setupProject io.android-trinity或io.android.trinity 。 這裡什麼都沒有石頭,並且根據社區的工作和要求可以改變和發展。因此,如果您想做出貢獻,請隨時打開問題並正確標記:錯誤,增強等。或發送PR。請兩者都很好地描述意圖,以便促進審查
Copyright 2021 Fernando Cejas
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
