Skip to content

Instantly share code, notes, and snippets.

View ValeryPonomarenko's full-sized avatar
:octocat:
Coding

Valery ValeryPonomarenko

:octocat:
Coding
  • Toronto
View GitHub Profile
@ValeryPonomarenko
ValeryPonomarenko / AnotherFragment.kt
Created September 14, 2018 15:13
Lifecycle aware dagger components
class AnotherFragment : Fragment(), IHasComponent {
//code...
override fun getComponent(): AnotherFeatureComponent =
DaggerAnotherFeatureComponent.builder()
.appDependency(InjectionManager.instance.findComponent())
.build()
}
@ValeryPonomarenko
ValeryPonomarenko / run_firebase_tests.sh
Last active January 9, 2019 10:40
Android CircleCI
#!/bin/bash
gcloud firebase test android run \
--type instrumentation \
--app ../app/build/outputs/apk/debug/app-debug.apk \
--test ../app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk \
--device-ids Nexus6 \
--os-version-ids 21 \
--locales en \
--orientations portrait \
--async
@ValeryPonomarenko
ValeryPonomarenko / download_ci_data.sh
Last active October 19, 2018 13:09
Android CircleCI
#!/bin/bash
curl -X POST https://content.dropboxapi.com/2/files/download \
--header "Authorization: Bearer $DROPBOX_KEY" \
--header "Dropbox-API-Arg: {\"path\": \"/$SIGNING_ARCHIVE_NAME\"}" \
-o "./$SIGNING_ARCHIVE_NAME" \
&& unzip -o $SIGNING_ARCHIVE_NAME \
&& rm $SIGNING_ARCHIVE_NAME
@ValeryPonomarenko
ValeryPonomarenko / unit-tests.yml
Created October 15, 2018 09:41
Android CircleCI
unit-tests:
<<: *defaults
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Install fastlane
command: bundle install
- run:
instrumentation-tests:
<<: *defaults
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Install fastlane
command: bundle install
- run:
@ValeryPonomarenko
ValeryPonomarenko / deploy-internal.yml
Last active October 21, 2018 19:27
Android CicleCI
deploy-internal:
<<: *defaults
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Install fastlane
command: bundle install
- run:
@ValeryPonomarenko
ValeryPonomarenko / workflows.yml
Created October 15, 2018 19:40
Android CircleCI
workflows:
version: 2
deploy-internal:
jobs:
- unit-tests
- instrumentation-tests
- hold:
type: approval
requires:
- unit-tests
@ValeryPonomarenko
ValeryPonomarenko / build.gradle
Last active October 18, 2018 09:55
Android CircleCI
//...
def props = new Properties()
file("../signing.properties").withInputStream { props.load(it) }
android {
//...
signingConfigs {
release {
keyAlias props.getProperty('keyAlias')
@ValeryPonomarenko
ValeryPonomarenko / config.yml
Last active June 13, 2022 00:45
Android CircleCI
version: 2
defaults: &defaults
docker:
- image: circleci/android:api-28-alpha
environment:
JVM_OPTS: -Xmx3200m
jobs:
unit-tests:
@ValeryPonomarenko
ValeryPonomarenko / fastfile
Created October 19, 2018 13:41
Android CircleCI
default_platform(:android)
platform :android do
desc "Run the unit tests"
lane :unit_tests do
gradle(task: "test")
end
desc "Assemble a debug apk"
lane :assemble_debug do