Skip to content

Instantly share code, notes, and snippets.

View martinbonnin's full-sized avatar
😃

Martin Bonnin martinbonnin

😃
View GitHub Profile
lintOptions {
// You can put severity configuration inside an XML file.
// Order inside the XML file is important.
setLintConfig(file("lint.xml"))
// Change the severity of the passed issueIds.
// Order is important.
// This overrides the XML configuration.
fatal("UnusedResources", "MissingTranslation")
error("UnusedResources", "MissingTranslation")
lintOptions {
// disable checks enabled by default
disable("RtlHardcoded", "RtlCompat")
// Enable some checks that are disabled by default.
enable("NegativeMargin", "GoogleAppIndexingApiWarning")
// Only check this exact list of issues
// Shorthand for disable(everything) and enable(these issues)
check("UnusedResources", "DevModeObsolete")
// Shorthand for enable(allWhereSeverityIsWarning)
// Severity is resolved at the start of configuration so this will not be affected by
MissingTranslation
------------------
Summary: Incomplete translation
Priority: 8 / 10
Severity: Fatal
Category: Correctness:Messages
If an application has more than one locale, then all the strings declared in
one language should also be translated in all other languages.
android {
lintOptions {
isCheckDependencies = true
}
}
// https://github.com/JetBrains/kotlin/blob/65244b4bea81f737466618927d4f3afe339cad0d/libraries/stdlib/jvm/src/kotlin/internal/PlatformImplementations.kt#L42
internal val IMPLEMENTATIONS: PlatformImplementations = run {
val version = getJavaVersion()
if (version >= 0x10008) {
try {
return@run castToBaseType<PlatformImplementations>(Class.forName("kotlin.internal.jdk8.JDK8PlatformImplementations").newInstance())
} catch (e: ClassNotFoundException) { }
try {
return@run castToBaseType<PlatformImplementations>(Class.forName("kotlin.internal.JRE8PlatformImplementations").newInstance())
} catch (e: ClassNotFoundException) { }
val matchResult = Regex("(?<key>.*)=(?<value>.*)").matchEntire("jdk=8")
if (matchResult != null) {
println("key=${matchResult.groups.get("key")!!.value}")
}
val closeable = object: Closeable {
override fun close() {
throw Exception("exception from close")
}
}
closeable.use {
throw Exception("exception from use")
}
// Java6:
internal val IMPLEMENTATIONS: PlatformImplementations = run {
val version = getJavaVersion()
if (version >= 0x10008) {
try {
return@run castToBaseType<PlatformImplementations>(Class.forName("kotlin.internal.jdk8.JDK8PlatformImplementations").newInstance())
} catch (e: ClassNotFoundException) { }
try {
return@run castToBaseType<PlatformImplementations>(Class.forName("kotlin.internal.JRE8PlatformImplementations").newInstance())
} catch (e: ClassNotFoundException) { }
}
martin@bowser-castle ~ $ ls -al kotlin-stdlib-*.jar
1326269 Sep 14 16:58 kotlin-stdlib-1.3.50.jar
3129 Sep 14 16:58 kotlin-stdlib-jdk7-1.3.50.jar
15476 Sep 14 16:58 kotlin-stdlib-jdk8-1.3.50.jar
  • proper android variant support (e.g. files in src/debug/graphql will override those in src/main/graphql
  • do not require src/main/graphql anymore
  • proper multi project support
  • proper variant output
  • more verification for bad configurations fail if generateModelBuilder && generateKotlinModels
  • more tests
  • no more sonatype downloads for tests