Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated code #1189

Merged
merged 2 commits into from
Dec 13, 2022
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ import java.io.File
class ApiSurfacePlugin : Plugin<Project> {

override fun apply(target: Project) {
val srcDir = File(target.projectDir, "src")
val srcDir = File(File(target.projectDir, "src"), "main")
val genDir = File(File(target.buildDir, "generated"), "json2kotlin")
val surfaceFile = File(target.projectDir, FILE_NAME)
genDir.mkdirs()

target.tasks
.register(TASK_GEN_API_SURFACE, GenerateApiSurfaceTask::class.java) {
this.srcDir = File(srcDir, "main")
this.srcDir = srcDir
this.genDir = genDir
this.surfaceFile = surfaceFile
}
target.tasks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ open class GenerateApiSurfaceTask : DefaultTask() {
@get:InputDirectory
lateinit var srcDir: File

@get:InputDirectory
lateinit var genDir: File

@get: OutputFile
lateinit var surfaceFile: File
private lateinit var visitor: KotlinFileVisitor
Expand All @@ -31,6 +34,7 @@ open class GenerateApiSurfaceTask : DefaultTask() {
fun applyTask() {
visitor = KotlinFileVisitor()
visitDirectoryRecursively(srcDir)
visitDirectoryRecursively(genDir)

surfaceFile.printWriter().use {
it.print(visitor.description.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ open class GenerateJsonSchemaTask : DefaultTask() {
}

private fun getOutputDir(): File {
val srcDir = File(project.projectDir, "src")
val mainDir = File(srcDir, "main")
val genDir = File(project.buildDir, "generated")
val json2kotlinDir = File(genDir, "json2kotlin")
val mainDir = File(json2kotlinDir, "main")
val file = File(mainDir, "kotlin")
if (!file.exists()) file.mkdirs()
return file
Expand Down
662 changes: 331 additions & 331 deletions dd-sdk-android/apiSurface

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dd-sdk-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ android {

sourceSets.named("main") {
java.srcDir("src/main/kotlin")
java.srcDir("build/generated/json2kotlin/main/kotlin")
}
sourceSets.named("test") {
java.srcDir("src/test/kotlin")
Expand Down
42 changes: 21 additions & 21 deletions library/dd-sdk-android-session-replay/apiSurface
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,27 @@ class com.datadog.android.sessionreplay.SessionReplayLifecycleCallback : Lifecyc
enum com.datadog.android.sessionreplay.SessionReplayPrivacy
- ALLOW_ALL
- MASK_ALL
class com.datadog.android.sessionreplay.net.BatchesToSegmentsMapper
fun map(List<ByteArray>): List<Pair<com.datadog.android.sessionreplay.model.MobileSegment, com.google.gson.JsonObject>>
companion object
class com.datadog.android.sessionreplay.net.BytesCompressor
fun compressBytes(ByteArray): ByteArray
companion object
data class com.datadog.android.sessionreplay.processor.EnrichedRecord
constructor(String, String, String, List<com.datadog.android.sessionreplay.model.MobileSegment.MobileRecord>)
fun toJson(): String
companion object
const val APPLICATION_ID_KEY: String
const val SESSION_ID_KEY: String
const val VIEW_ID_KEY: String
const val RECORDS_KEY: String
interface com.datadog.android.sessionreplay.utils.RumContextProvider
fun getRumContext(): SessionReplayRumContext
data class com.datadog.android.sessionreplay.utils.SessionReplayRumContext
constructor(String = NULL_UUID, String = NULL_UUID, String = NULL_UUID)
companion object
interface com.datadog.android.sessionreplay.utils.TimeProvider
fun getDeviceTimestamp(): Long
data class com.datadog.android.sessionreplay.model.MobileSegment
constructor(Application, Session, View, kotlin.Long, kotlin.Long, kotlin.Long, kotlin.Long? = null, kotlin.Boolean? = null, Source, kotlin.collections.List<MobileRecord>)
fun toJson(): com.google.gson.JsonElement
Expand Down Expand Up @@ -265,24 +286,3 @@ data class com.datadog.android.sessionreplay.model.MobileSegment
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Vertical
class com.datadog.android.sessionreplay.net.BatchesToSegmentsMapper
fun map(List<ByteArray>): List<Pair<com.datadog.android.sessionreplay.model.MobileSegment, com.google.gson.JsonObject>>
companion object
class com.datadog.android.sessionreplay.net.BytesCompressor
fun compressBytes(ByteArray): ByteArray
companion object
data class com.datadog.android.sessionreplay.processor.EnrichedRecord
constructor(String, String, String, List<com.datadog.android.sessionreplay.model.MobileSegment.MobileRecord>)
fun toJson(): String
companion object
const val APPLICATION_ID_KEY: String
const val SESSION_ID_KEY: String
const val VIEW_ID_KEY: String
const val RECORDS_KEY: String
interface com.datadog.android.sessionreplay.utils.RumContextProvider
fun getRumContext(): SessionReplayRumContext
data class com.datadog.android.sessionreplay.utils.SessionReplayRumContext
constructor(String = NULL_UUID, String = NULL_UUID, String = NULL_UUID)
companion object
interface com.datadog.android.sessionreplay.utils.TimeProvider
fun getDeviceTimestamp(): Long
1 change: 1 addition & 0 deletions library/dd-sdk-android-session-replay/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ android {

sourceSets.named("main") {
java.srcDir("src/main/kotlin")
java.srcDir("build/generated/json2kotlin/main/kotlin")
}
sourceSets.named("test") {
java.srcDir("src/test/kotlin")
Expand Down