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
with (URL(url).openConnection() as HttpsURLConnection) { | |
val trustManager = object : X509TrustManager { | |
override fun checkClientTrusted(chain: Array<out X509Certificate>?, authType: String?) = Unit | |
override fun checkServerTrusted(chain: Array<out X509Certificate>?, authType: String?) { | |
// TODO validate the chain, and throw an exception if invalid. | |
} | |
override fun getAcceptedIssuers() = emptyArray<X509Certificate>() | |
} |
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
androidTestImplementation 'androidx.test:core:1.2.0' | |
androidTestImplementation 'androidx.test.ext:junit:1.1.1' | |
androidTestImplementation 'androidx.test:runner:1.2.0' | |
androidTestImplementation 'androidx.multidex:multidex:2.0.1' | |
// https://handstandsam.com/2016/01/30/running-wiremock-on-android/ | |
androidTestImplementation('com.github.tomakehurst:wiremock:2.26.3') { | |
// Allows us to use the Android version of Apache httpclient instead | |
exclude group: 'org.apache.httpcomponents', module: 'httpclient' |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.acme.example"> | |
<uses-permission android:name="android.permission.INTERNET"/> | |
<application android:name="androidx.multidex.MultiDexApplication"> | |
<uses-library android:name="org.apache.http.legacy" android:required="false" /> | |
</application> |
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 SomeTest { | |
private val context = getApplicationContext<Context>() | |
@Rule @JvmField val wireMockRule: WireMockRule | |
init { | |
// Copy the keystore from assets into the cache dir so wiremock can access it. | |
// The key pair entry uses the password "password". Wiremock does not support a | |
// password on the keystore itself. The cert specifies a SAN of 127.0.0.1. |
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
kotlin { | |
ios { | |
compilations["main"].defaultSourceSet { | |
dependsOn(sourceSets["iosMain"]) | |
} | |
val targetName = name.toLowerCase() | |
binaries.framework { | |
// Currently exported dependencies have to be target-specific, so add in the target |
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
artifactory { | |
setContextUrl("https://host.example.com/artifactory/") | |
publish(delegateClosureOf<PublisherConfig> { | |
repository(delegateClosureOf<DoubleDelegateWrapper> { | |
setProperty("repoKey", "example-repo") | |
setProperty("username", "aUsername") | |
setProperty("password", "aPassword") | |
setProperty("maven", true) | |
}) | |
defaults(delegateClosureOf<groovy.lang.GroovyObject> { |
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.named<DokkaTask>("dokka") { | |
multiplatform { | |
create("android") { | |
targets = listOf("Android") | |
platform = "jvm" | |
skipEmptyPackages = true | |
} | |
create("ios") { | |
targets = listOf("iOS") | |
platform = "native" |
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
kotlin { | |
android { | |
publishAllLibraryVariants() | |
} | |
iosX64("ios") { | |
mavenPublication { | |
artifactId = "${project.name}-iosx64" | |
} | |
} | |
iosArm64 { |
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
Properties moduleProperties = new Properties() | |
File modulePropertiesFile = file(rootDir.absolutePath + '/modules.properties') | |
def buildMyModule = false | |
if (modulePropertiesFile.exists()) { | |
moduleProperties.load(sdkPropertiesFile.newDataInputStream()) | |
buildMyModule = moduleProperties.getProperty('build.myModule', 'false').toBoolean() | |
} |
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
import org.jetbrains.kotlin.gradle.plugin.mpp.Framework | |
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget | |
import org.jetbrains.kotlin.gradle.tasks.FatFrameworkTask | |
buildscript { | |
project.extra["iosFrameworkName"] = "iOSAppUmbrella" | |
repositories { | |
google() |
NewerOlder