Skip to content

Instantly share code, notes, and snippets.

@koral--
koral-- / build.gradle.kts
Created Mar 2, 2020
GenerateNavArgsProguardRulesTask usage
View build.gradle.kts
tasks {
named("preBuild").dependsOn(register("generateNavArgsProguardRules", GenerateNavArgsProguardRulesTask::class))
}
android {
defaultConfig {
consumerProguardFile(File(buildDir, NAVARGS_PROGUARD_RULES_PATH))
}
}
@koral--
koral-- / build.gradle.kts
Created Mar 2, 2020
GenerateNavArgsProguardRulesTask registration
View build.gradle.kts
tasks {
named("preBuild").dependsOn(register("generateNavArgsProguardRules", GenerateNavArgsProguardRulesTask::class))
}
@koral--
koral-- / GenerateNavArgsProguardRulesTask.kt
Created Mar 2, 2020
Complete GenerateNavArgsProguardRulesTask
View GenerateNavArgsProguardRulesTask.kt
import org.gradle.api.DefaultTask
import org.gradle.api.file.FileTree
import org.gradle.api.tasks.*
import java.io.File
import javax.xml.parsers.DocumentBuilderFactory
const val NAVARGS_PROGUARD_RULES_PATH = "generated/proguard-rules/navargs-proguard-rules.pro"
private const val APP_NAMESPACE = "http://schemas.android.com/apk/res-auto"
@CacheableTask
@koral--
koral-- / GenerateNavArgsProguardRulesTask.kt
Last active Mar 2, 2020
GenerateNavArgsProguardRulesTask action
View GenerateNavArgsProguardRulesTask.kt
private const val APP_NAMESPACE = "http://schemas.android.com/apk/res-auto"
abstract class GenerateNavArgsProguardRulesTask : DefaultTask() {
@get:InputFiles
@get:SkipWhenEmpty
val navigationGraphFiles: FileTree = project.fileTree("src/main/res/navigation") {
include("*.xml")
}
@koral--
koral-- / GenerateNavArgsProguardRulesTask.kt
Last active Mar 2, 2020
GenerateNavArgsProguardRulesTask inputs and outputs
View GenerateNavArgsProguardRulesTask.kt
const val NAVARGS_PROGUARD_RULES_PATH = "generated/proguard-rules/navargs-proguard-rules.pro"
abstract class GenerateNavArgsProguardRulesTask : DefaultTask() {
@get:InputFiles
@get:SkipWhenEmpty
val navigationGraphFiles: FileTree = project.fileTree("src/main/res/navigation") {
include("*.xml")
}
@koral--
koral-- / GenerateNavArgsProguardRulesTask.kt
Created Mar 1, 2020
GenerateNavArgsProguardRulesTask skeleton
View GenerateNavArgsProguardRulesTask.kt
abstract class GenerateNavArgsProguardRulesTask : DefaultTask() {
}
@koral--
koral-- / bitrise.yml
Last active Nov 12, 2019
Sample Bitrise workflows configuration
View bitrise.yml
---
format_version: '8'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: android
trigger_map:
- push_branch: master
workflow: deploy-staging
- pull_request_source_branch: "*"
workflow: verification
- tag: "*"
View build.gradle
buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath "com.android.tools.build:gradle:+"
}
}
@koral--
koral-- / build.gradle
Last active Feb 6, 2019
JitPack sample
View build.gradle
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
jcenter()
}
@koral--
koral-- / build.gradle
Last active Jan 30, 2019
Build.gradle example
View build.gradle
repositories {
mavenCentral()
jcenter()
gradlePluginPortal()
maven { url 'https://jitpack.io' }
}