This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: softartdev/android-fastlane | |
cache: | |
key: ${CI_PROJECT_ID} | |
paths: | |
- .gradle/ | |
before_script: | |
- chmod +x ./gradlew | |
- echo "$ENV_PROP" > local.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
json_key_file("/service_account.json") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one | |
package_name("id.sydev.justversion") # e.g. com.krausefx.app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file contains the fastlane.tools configuration | |
# You can find the documentation at https://docs.fastlane.tools | |
# | |
# For a list of all available actions, check out | |
# | |
# https://docs.fastlane.tools/actions | |
# | |
# For a list of all available plugins, check out | |
# | |
# https://docs.fastlane.tools/plugins/available-plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: jangrewe/gitlab-ci-android | |
cache: | |
key: ${CI_PROJECT_ID} | |
paths: | |
- .gradle/ | |
before_script: | |
- chmod +x ./gradlew |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun `Await Test`() { | |
runBlocking { | |
val deferred: Deferred<String> = async { return@async Thread.currentThread().name } | |
println(deferred.await()) | |
} | |
} | |
@Test | |
fun `AwaitAll Test`() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun `direct throw exception in launch with try-catch`() { | |
runBlocking { | |
val job = launch { | |
println("start job") | |
throw IllegalArgumentException("throw IllegalArgumentException from launch") | |
} | |
try { | |
job.join() | |
} catch (e: IllegalArgumentException) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val exceptionHandling = CoroutineExceptionHandler { coroutineContext, throwable -> | |
print("got error: ${throwable.message}") | |
} | |
@Test | |
fun `exception with handling in launch with scope`() { | |
runBlocking { | |
val job = GlobalScope.launch(exceptionHandling) { | |
println("start job") | |
throw IllegalArgumentException("throw IllegalArgumentException from launch") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun `direct throw exception in async with scope with try-catch`() { | |
runBlocking { | |
val deferred: Deferred<String> = GlobalScope.async { | |
println("start job") | |
throw IllegalArgumentException("throw IllegalArgumentException from launch") | |
} | |
try { | |
println(deferred.await()) | |
} catch (e: IllegalArgumentException) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun `Join Test`() { | |
runBlocking { | |
val job : Job = launch { println(Thread.currentThread().name) } | |
job.join() | |
} | |
} | |
@Test | |
fun `JoinAll Test`() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : AppCompatActivity() { | |
// initialize view model, in this case using koin extension | |
private val viewModel: MainViewModel by viewModel() | |
// observe value | |
viewModel.name.observe(this, ::setName) | |
private fun setName(name: String?) = binding.edtName.setText(name) | |
// fetch data on the first time / activtity created |
NewerOlder