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
dependencies { | |
testImplementation 'com.github.IvanShafran:shared-preferences-mock:1.0' | |
} |
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
allprojects { | |
repositories { | |
... | |
maven { url 'https://jitpack.io' } | |
} | |
} |
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
... | |
apply from: 'signing.gradle' | |
... | |
android { | |
... | |
buildTypes { | |
release { | |
signingConfig signingConfigs.release | |
minifyEnabled false | |
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
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
def propertiesFilename = "production.properties" | |
if (!project.file(propertiesFilename).exists()) { | |
propertiesFilename = "contributors.properties" | |
} | |
def signingProperties = new Properties() | |
signingProperties.load(new FileInputStream(file(propertiesFilename))) | |
android { | |
signingConfigs { |
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
# Sign key alias for contributors.jks | |
releaseSignKeyAlias=key | |
# Sign key password for contributors.jks | |
releaseSignKeyPassword=password | |
# Path to contributors.jks | |
releaseStoreFilePath=./contributors.jks | |
# Keystore password for contributors.jks | |
releaseStorePassword=password |
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 Sample { | |
companion object { | |
init { | |
DependencyChecker.check() | |
} | |
} | |
} |
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
public class DependencyChecker { | |
public static void check() throws ClassNotFoundException { | |
try { | |
// Intrinsics exists in all std-lib versions | |
Class.forName("kotlin.jvm.internal.Intrinsics"); | |
} catch (ClassNotFoundException e) { | |
throw new ClassNotFoundException("Library depends on Kotlin std-lib.\n" + | |
"Add to dependencies: org.jetbrains.kotlin:kotlin-stdlib:1.3.31" | |
); | |
} |
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 Sample { | |
companion object { | |
@JvmField | |
val INSTANCE = Sample() | |
} | |
} |
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
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { | |
kotlinOptions { | |
apiVersion = "1.2" | |
languageVersion = "1.2" | |
} | |
} |