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
android { | |
defaultConfig { | |
versionName "1.9.1" | |
versionCode getBuildVersion() as int | |
} | |
} | |
// Don't name this getVersionCode() or things will break | |
static def getBuildVersion() { | |
def version = 123 |
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
// Deployment | |
play { | |
track = getDeploymentTrack() | |
serviceAccountCredentials = file(System.getenv("PRIVATE_KEY") ?: "deployment_private_key.json") | |
defaultToAppBundles = true | |
resolutionStrategy = "ignore" | |
} | |
// The deployment track is based on the branch. | |
static def getDeploymentTrack() { |
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
version: 2 | |
jobs: | |
build: | |
working_directory: ~/code | |
docker: | |
- image: circleci/android:api-25-alpha | |
environment: | |
JVM_OPTS: -Xmx3200m | |
steps: | |
- checkout |
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
workflows: | |
version: 2 | |
build-and-deploy: | |
jobs: | |
- build | |
- tests: | |
requires: | |
- build | |
- deploy: |
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
version: 2 | |
jobs: | |
deploy_staging: | |
working_directory: ~/code | |
docker: | |
- image: circleci/android:api-25-alpha | |
environment: | |
JVM_OPTS: -Xmx3200m | |
steps: | |
- checkout |
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
@Entity(tableName = "UserTable") | |
internal data class User( | |
@PrimaryKey val id: String, | |
val name: String, | |
val surname: String, | |
val birthday: Long | |
) |
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
dependency { | |
implementation "androidx.room:room-runtime:$roomVersion | |
kapt "androidx.room:room-compiler:$roomVersion" | |
} |
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
// In your shared domain/core module | |
data class User( | |
val id: String, | |
val name: String, | |
val surname: String, | |
val age: Int | |
) | |
// In your database module ONLY | |
@Entity(tableName = "UserTable") |
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 UserRepository(private val database: DeviceDatabase) { | |
val liveUsers: LiveData<List<User>> = Transformations.map(database.userDao().liveUsers) { | |
it.map { | |
it.toUser() | |
} | |
} | |
} |
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
interface RetroService | |
interface GitHubService: RetroService { | |
@GET("users/{user}/repos") | |
fun listGitHubRepos(@Path("user") user: String): List<GitHubRepo> | |
} | |
interface AwsCodeCommitService: RetroService { | |
@GET("ListRepositories") | |
fun listAwsRepos(): List<AwsRepo> |
OlderNewer