This file contains hidden or 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
| buildscript { | |
| repositories { | |
| mavenCentral() | |
| } | |
| dependencies { | |
| classpath 'com.github.leandroborgesferreira:dag-command:1.5.2' | |
| } | |
| } |
This file contains hidden or 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
| import com.github.leandroborgesferreira.dagcommand.DagCommandPlugin | |
| import com.github.leandroborgesferreira.dagcommand.extension.CommandExtension | |
| buildscript { | |
| repositories { | |
| mavenCentral() // or jcenter() | |
| } | |
| dependencies { | |
| classpath("com.github.leandroborgesferreira:dag-command:1.5.2") |
This file contains hidden or 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
| import os | |
| import json | |
| def parse_modules(modules_file): | |
| modules = [] | |
| with open(modules_file, 'r') as file: | |
| return json.loads(file.read()) | |
| def parse_unit_test_command(modules): | |
| command = "./gradlew " |
This file contains hidden or 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
| Steps for installing the Android Emulator from EC2 console: | |
| ----------------------------------------------------------- | |
| sudo apt install default-jdk | |
| wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip | |
| unzip sdk-tools-linux-4333796.zip -d android-sdk | |
| sudo mv android-sdk /opt/ | |
| export ANDROID_SDK_ROOT=/opt/android-sdk | |
| echo "export ANDROID_SDK_ROOT=/opt/android-sdk" >> ~/.bashrc | |
| echo "export PATH=$PATH:$ANDROID_SDK_ROOT/tools" >> ~/.bashrc | |
| re-login |
This file contains hidden or 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
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContentView(R.layout.activity_main) | |
| setupList(repoList) | |
| presenter = initPresenter(IO.async()) | |
| presenter | |
| .drawRepositories() | |
| .fix() |
This file contains hidden or 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 RepositoryDataSource<F>( | |
| private val apiClient: ApiClient, | |
| async: Async<F> | |
| ) : Async<F> by async { | |
| fun fetchAllRepositories(): Kind<F, List<Repository>> = | |
| apiClient.getRepositories("Java", "star", 1) | |
| .async(this) | |
| .flatMap { response -> response.unwrapBody(this) } | |
| .map { dto -> dto.items } |
This file contains hidden or 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 RepositoryUseCase<F>( | |
| private val dataSource: RepositoryDataSource<F> | |
| ) : Kind<F, List<Repository>>, Async<F> by dataSource{ | |
| fun getRepositories() : Kind<F, List<Repository>> = | |
| dataSource.fetchAllRepositories().continueOn(Dispatchers.Main) | |
| } |
This file contains hidden or 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 RepositoryPresenter<F>( | |
| private val repositoryUseCase: RepositoryUseCase<F>, | |
| private val view: RepositoriesView, | |
| private val cancelableList: MutableList<Disposable> = mutableListOf() | |
| ) : Async<F> by repositoryUseCase { | |
| fun drawRepositories() : Kind<F, Unit> { | |
| val (kind, disposable) = bindingCancellable { | |
| val repos = repositoryUseCase.getRepositories().handleError { | |
| view.showGenericError() |
This file contains hidden or 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(), RepositoriesView { | |
| private val repoList: MutableList<Repository> = mutableListOf() | |
| lateinit var presenter: RepositoryPresenter<ForObservableK> | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContentView(R.layout.activity_main) | |
| setupList(repoList) |
This file contains hidden or 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 RepositoryDataSource<F>( | |
| private val async: Async<F>, | |
| private val apiClient: ApiClient | |
| ) { | |
| fun fetchAllRepositories(): Kind<F, List<Repository>> = | |
| async.run { | |
| apiClient.getRepositories("Java", "star", 1) | |
| .async(this) | |
| .flatMap { response -> response.unwrapBody(this) } | |
| .map { dto -> dto.items } |
NewerOlder