Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 0 additions & 46 deletions android/benchmark/build.gradle

This file was deleted.

28 changes: 0 additions & 28 deletions android/benchmark/src/androidTest/AndroidManifest.xml

This file was deleted.

20 changes: 0 additions & 20 deletions android/benchmark/src/main/AndroidManifest.xml

This file was deleted.

1 change: 1 addition & 0 deletions androidBenchmark/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
37 changes: 37 additions & 0 deletions androidBenchmark/benchmark-proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

-dontobfuscate

-ignorewarnings

-keepattributes *Annotation*

-dontnote junit.framework.**
-dontnote junit.runner.**

-dontwarn androidx.test.**
-dontwarn org.junit.**
-dontwarn org.hamcrest.**
-dontwarn com.squareup.javawriter.JavaWriter

-keepclasseswithmembers @org.junit.runner.RunWith public class *
54 changes: 54 additions & 0 deletions androidBenchmark/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
plugins {
id "com.android.library"
id "androidx.benchmark"
id "org.jetbrains.kotlin.android"
}

android {
namespace "dev.zacsweers.jsonserialization.android"
compileSdk 33

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}

defaultConfig {
minSdk 24
targetSdk 33

testInstrumentationRunner "androidx.benchmark.junit4.AndroidBenchmarkRunner"
}

testBuildType = "release"
buildTypes {
debug {
// Since debuggable can"t be modified by gradle for library modules,
// it must be done in a manifest - see src/androidTest/AndroidManifest.xml
minifyEnabled true
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "benchmark-proguard-rules.pro"
}
release {
isDefault = true
}
}
}

configurations {
androidTest.extendsFrom(implementation)
}

dependencies {
androidTestImplementation "com.google.guava:guava:31.1-jre"
androidTestImplementation "com.squareup.okio:okio:3.3.0"
androidTestImplementation "androidx.benchmark:benchmark-junit4:1.1.1"
androidTestImplementation "junit:junit:4.13.2"
androidTestImplementation "androidx.test:runner:1.5.2"
androidTestImplementation "androidx.test:rules:1.5.0"
androidTestImplementation "androidx.test.ext:junit:1.1.5"
implementation project(":models")
}
15 changes: 15 additions & 0 deletions androidBenchmark/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<!--
Important: disable debugging for accurate performance results

In a com.android.library project, this flag must be disabled from this
manifest, as it is not possible to override this flag from Gradle.
-->
<application
android:debuggable="false"
tools:ignore="HardcodedDebugMode"
tools:replace="android:debuggable" />
</manifest>
2 changes: 2 additions & 0 deletions androidBenchmark/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest />
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ private fun printResults(type: ResultType, results: List<Analysis>) {
}

val output = buildString {
appendln()
appendLine()
append(type.description)
appendln(':')
appendln()
appendln("```")
appendLine(':')
appendLine()
appendLine("```")
groupedResults.entries
.joinTo(this, "\n\n", postfix = "\n```") { (grouping, matchedAnalyses) ->
val content = matchedAnalyses.sortedBy { it.score }
Expand Down Expand Up @@ -161,4 +161,4 @@ internal data class Analysis(
}

internal operator fun <T> List<T>.component6(): T = this[5]
internal operator fun <T> List<T>.component7(): T = this[6]
internal operator fun <T> List<T>.component7(): T = this[6]
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ private fun printResults(type: PolymorphicResultType, results: List<Analysis>) {
}

val output = buildString {
appendln()
appendLine()
append(type.description)
appendln(':')
appendln()
appendln("```")
appendLine(':')
appendLine()
appendLine("```")
groupedResults.entries
.joinTo(this, "\n\n", postfix = "\n```") { (grouping, matchedAnalyses) ->
val content = matchedAnalyses.sortedBy { it.score }
Expand Down
31 changes: 12 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,37 +1,30 @@
ext.kotlin_version = '1.4.10'
ext.serialization_version = '1.0.0'
ext.jmh_version = '1.22'
ext.kotlin_version = "1.8.10"
ext.serialization_version = "1.5.0-RC"
ext.jmh_version = "1.36"

buildscript {
ext.kotlin_version = '1.4.10'
ext.serialization_version = '1.0.0'
ext.jmh_version = '1.22'
ext.kotlin_version = "1.8.10"
ext.serialization_version = "1.5.0-RC"
ext.jmh_version = "1.36"
repositories {
google()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
maven { url "https://kotlin.bintray.com/kotlinx" }
jcenter()
gradlePluginPortal()
}
dependencies {
classpath "com.android.tools.build:gradle:3.6.0"
classpath "me.champeau.gradle:jmh-gradle-plugin:0.5.0"
classpath "net.ltgt.gradle:gradle-apt-plugin:0.21"
classpath "com.android.tools.build:gradle:7.4.0"
classpath "me.champeau.jmh:jmh-gradle-plugin:0.6.6"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath "com.github.jengelman.gradle.plugins:shadow:5.2.0"
classpath "androidx.benchmark:benchmark-gradle-plugin:1.0.0"
// classpath "gradle.plugin.com.github.jengelman.gradle.plugins:shadow:7.1.2"
classpath "androidx.benchmark:benchmark-gradle-plugin:1.1.1"
}
}

subprojects {
repositories {
google()
mavenCentral()
jcenter()
maven { url "https://kotlin.bintray.com/kotlinx" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
}
}
9 changes: 9 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
org.gradle.jvmargs=-Xmx4096m -XX:+UseParallelGC
org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.caching=true
android.useAndroidX=true
android.enableJetifier=false
kotlin.code.style=official
org.gradle.vfs.watch=true
org.gradle.unsafe.configuration-cache=true
kotlin.incremental.useClasspathSnapshot=true
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading