Skip to content

Commit

Permalink
feat: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
finalchild committed Sep 3, 2024
1 parent b1e87a8 commit b4edf05
Show file tree
Hide file tree
Showing 17 changed files with 7,522 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

# Ignore Gradle build output directory
build

# schema file
/openapi/portone-v2-openapi.json
4 changes: 4 additions & 0 deletions buildSrc/.kotlin/errors/errors-1725266929220.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
kotlin version: 2.0.20
error message: The daemon has terminated unexpectedly on startup attempt #1 with error code: 0. The daemon process output:
1. Kotlin compile daemon is ready

4 changes: 4 additions & 0 deletions buildSrc/.kotlin/errors/errors-1725269772908.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
kotlin version: 2.0.20
error message: The daemon has terminated unexpectedly on startup attempt #1 with error code: 0. The daemon process output:
1. Kotlin compile daemon is ready

4 changes: 4 additions & 0 deletions buildSrc/.kotlin/errors/errors-1725362496451.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
kotlin version: 2.0.20
error message: The daemon has terminated unexpectedly on startup attempt #1 with error code: 0. The daemon process output:
1. Kotlin compile daemon is ready

14 changes: 14 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
plugins {
kotlin("jvm") version "2.0.20"
kotlin("plugin.serialization") version "2.0.20"

}

dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.1")
implementation("com.squareup:kotlinpoet-jvm:1.18.1")
}

repositories {
mavenCentral()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package io.portone.openapi

import kotlinx.serialization.json.Json
import kotlinx.serialization.json.jsonObject
import org.gradle.api.DefaultTask
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.TaskAction
import java.nio.file.Files

abstract class GenerateSchemaCodeTask : DefaultTask() {
@get:InputFile
abstract val inputFile: RegularFileProperty

@get:OutputDirectory
abstract val outputDirectory: DirectoryProperty

@TaskAction
fun generateSchemaCode() {
val document = Json.parseToJsonElement(Files.readString(inputFile.get().asFile.toPath())).jsonObject
SchemaGenerator(document, listOf(
"/payments",
"/payment-schedules",
"/identity-verifications",
"/billing-keys",
"/cash-receipts",
"/kakaopay",
), outputDirectory.get().asFile.toPath()).generateFiles()
}
}
Loading

0 comments on commit b4edf05

Please sign in to comment.