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 extensions.android | |
import extensions.variants | |
import org.gradle.api.GradleException | |
import org.gradle.api.Plugin | |
import org.gradle.api.Project | |
import java.io.File | |
internal class MyFirstPlugin : Plugin<Project> { | |
companion object { |
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 extensions.writeXlmWithTags | |
import org.gradle.api.DefaultTask | |
import org.gradle.api.tasks.InputFile | |
import org.gradle.api.tasks.OutputFile | |
import org.gradle.api.tasks.TaskAction | |
import java.io.File | |
internal open class ColorsTask : DefaultTask(){ | |
@get:OutputFile | |
lateinit var outputFile: File |
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 android.databinding.tool.util.StringUtils | |
import java.util.* | |
import java.util.regex.Pattern | |
fun getAllPossibleFileLocationsByVariantDirectory(variantDirname: String): List<String> { | |
val VARIANT_PATTERN = | |
Pattern.compile("""(?:([^\p{javaUpperCase}]+)((?:\p{javaUpperCase}[^\p{javaUpperCase}]*)*)/)?([^/]*)""") | |
val FLAVOR_PATTERN = Pattern.compile("""(\p{javaUpperCase}[^\p{javaUpperCase}]*)""") |
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
color1,#ff0000 | |
color2,#9f0101 | |
color3,#450101 |
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
color1,#00ff00 | |
color2,#20ab06 | |
color3,#0d4402 |
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
String dimen = "palette" | |
flavorDimensions dimen | |
productFlavors { | |
reds { dimension dimen } | |
greens { dimension dimen } | |
} |
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
@get:Input | |
val colorsMap = mapOf( | |
"color1" to "#00ff00", | |
"color2" to "#ff0000", | |
"color3" to "#00ffff", | |
"color4" to "#00ffff" | |
) |
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 extensions.android | |
import extensions.variants | |
import org.gradle.api.Plugin | |
import org.gradle.api.Project | |
internal class MyFirstPlugin : Plugin<Project> { | |
override fun apply(project: Project) { | |
project.android().variants().all { variant -> |
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 extensions.android | |
import extensions.variants | |
import org.gradle.api.Plugin | |
import org.gradle.api.Project | |
import java.io.File | |
internal class MyFirstPlugin : Plugin<Project> { | |
override fun apply(project: Project) { | |
project.android().variants().all { variant -> |
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 extensions.writeXlmWithTags | |
import org.gradle.api.DefaultTask | |
import org.gradle.api.tasks.Input | |
import org.gradle.api.tasks.OutputFile | |
import org.gradle.api.tasks.TaskAction | |
import java.io.File | |
internal open class ColorsTask : DefaultTask(){ | |
@get:OutputFile | |
lateinit var outputFile: File |
NewerOlder