Skip to content

Commit

Permalink
v 1.0.0-1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamKwokX committed Nov 7, 2023
1 parent 95a4062 commit 38f6d5f
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion compiler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {

mavenPublishing {
def isSNAPSHOT = false
def version = "1.0.2"
def version = "1.0.0-1.0.0"
def artifactId = "tracer-compiler"

if (isSNAPSHOT) version += "-SNAPSHOT"
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ kt-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.
kt-test = { group = "org.jetbrains.kotlin", name = "kotlin-test", version.ref = "kt" }
ksp = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp" }
shawxingkwok-kt-util = { group = "io.github.shawxingkwok", name = "kt-util", version = "1.0.2" }
shawxingkwok-ksp-util = { group = "io.github.shawxingkwok", name = "ksp-util", version = "1.0.1" }
shawxingkwok-ksp-util = { group = "io.github.shawxingkwok", name = "ksp-util", version = "1.0.2" }
tracer-annotaions = { group = "io.github.shawxingkwok", name = "tracer-annotations", version = "1.0.0" }
tracer-processor = { group = "io.github.shawxingkwok", name = "tracer-processor", version = "1.0.2" }
tracer-compiler = { group = "io.github.shawxingkwok", name = "tracer-compiler", version = "1.0.2" }
tracer-processor = { group = "io.github.shawxingkwok", name = "tracer-processor", version = "1.0.0-1.0.0" }
tracer-compiler = { group = "io.github.shawxingkwok", name = "tracer-compiler", version = "1.0.0-1.0.0" }
2 changes: 1 addition & 1 deletion processor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies{

mavenPublishing {
def isSNAPSHOT = false
def version = "1.0.2"
def version = "1.0.0-1.0.0"
def artifactId = "tracer-processor"

if (isSNAPSHOT) version += "-SNAPSHOT"
Expand Down
10 changes: 5 additions & 5 deletions processor/src/main/java/pers/shawxingkwok/tracer/MyProcessor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ internal object MyProcessor : KSProcessor {
}
if (notImplementedKSClasses.any())
Log.w(
obj = "Let classes below implement corresponding tracer interfaces.",
symbols = notImplementedKSClasses.toTypedArray()
symbols = notImplementedKSClasses,
msg = "Let classes below implement corresponding tracer interfaces.",
)
}

Expand Down Expand Up @@ -119,14 +119,14 @@ internal object MyProcessor : KSProcessor {
override fun onFinish() {
if (invalidRootNodesTypeParameterInfo.any())
Log.e(
obj = "Type parameters below, essential for building tracer interfaces, are invalid.",
symbols = invalidRootNodesTypeParameterInfo.map { it.second }.toTypedArray(),
symbols = invalidRootNodesTypeParameterInfo.map { it.second },
msg = "Type parameters below, essential for building tracer interfaces, are invalid.",
)

if (Tags.interfacesBuilt
&& MyProcessor::invalidSymbolsInfo.isInitialized
&& invalidSymbolsInfo.any()
)
Log.e("Tracer properties building are stopped because some invalid symbols.")
Log.w(null, "Tracer properties building are stopped because some invalid symbols.")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal class TestProcessor : KSProcessor{
class Provider : KSProcessorProvider(::TestProcessor)

override fun process(round: Int): List<KSAnnotated> {
Log.d(round)
Log.d(null, round)

if (round == 0){
val ksClass = resolver.getClassDeclarationByName("generic.X")!!
Expand All @@ -36,10 +36,10 @@ internal class TestProcessor : KSProcessor{
.type.resolve()
.declaration as KSTypeParameter

Log.w(param == _param)
Log.d(param == _param)
Log.d(param.bounds.first().resolve())
Log.d(_param.bounds.first().resolve())
Log.w(null, param == _param)
Log.d(null, param == _param)
Log.d(null, param.bounds.first().resolve())
Log.d(null, _param.bounds.first().resolve())
}
return emptyList()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ internal class PropsBuilder(val srcKSClass: KSClassDeclaration) {
.onEachIndexed{ i, _->
if (i != 0) return@onEachIndexed

Log.require(
Log.check(
symbols = listOfNotNull(parentKSProp, ksClass),
condition = ksClass !in record.validlyTracedInsideKSClasses
&& ksClass !in record.tracedKSClassesStoppedTracingInsideForNullability,
symbols = listOfNotNull(parentKSProp, ksClass)
){
record.getErrorMsg(ksClass)
}
Expand Down Expand Up @@ -107,9 +107,9 @@ internal class PropsBuilder(val srcKSClass: KSClassDeclaration) {
.filterNot { (_, basicType) -> basicType.ksClass.isAnnotatedRootOrNodes() }
.filterNot { (ksProp, basicType) ->
if (basicType.isNullable) {
Log.require(
condition = basicType.ksClass !in record.validlyTracedInsideKSClasses,
Log.check(
symbols = listOf(ksProp, ksClass),
condition = basicType.ksClass !in record.validlyTracedInsideKSClasses,
){
record.getErrorMsg(basicType.ksClass)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ private val cache = mutableMapOf<KSNode, Boolean>().alsoRegister()
// TODO(consider undoing cache)
internal fun KSNode.myValidate(): Boolean =
cache.getOrPut(this) {
accept(KSDefaultValidator, Unit)
accept(KSDefaultValidator(), Unit)
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ private var valid = true
private inline fun requireNone(symbols: List<KSNode>, getMsg: () -> String){
if (symbols.any()){
valid = false
Log.e(obj = getMsg(), symbols = symbols.distinct().toTypedArray())
Log.e(symbols = symbols.distinct(), msg = getMsg())
}
}

Expand Down Expand Up @@ -96,7 +96,7 @@ private fun checkOmittedProps() {
.values

if (reasons.any())
Log.w("Property $prop is $reasons and always omitted in tracer building, " +
Log.w(null, "Property $prop is $reasons and always omitted in tracer building, " +
"which means annotating ${Names.Omit} on it makes no sense.")
}
}
Expand Down
3 changes: 1 addition & 2 deletions sample/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/build
/src/test/java/X.kt
/build

0 comments on commit 38f6d5f

Please sign in to comment.