未验证 提交 7dc493d9 编写于 作者: 梦境迷离's avatar 梦境迷离 提交者: GitHub

Ready to move org (#126)

上级 8e4da614
......@@ -16,5 +16,5 @@ comment:
behavior: default
ignore:
- "src/main/scala/io/github/dreamylost/package.scala"
- "src/main/scala/io/github/dreamylost/macros/macros.scala"
\ No newline at end of file
- "src/main/scala/org/bitlap/tools/package.scala"
- "src/main/scala/org/bitlap/tools/macros/macros.scala"
<img align="right" width="30%" height="30%" src="img.png" alt="https://dreamylost.cn"/>
<img align="right" width="30%" height="30%" src="img.png" alt="https://bitlap.org"/>
# scala-macro-tools
[![Build](https://github.com/jxnu-liguobin/scala-macro-tools/actions/workflows/ScalaCI.yml/badge.svg)](https://github.com/jxnu-liguobin/scala-macro-tools/actions/workflows/ScalaCI.yml)
[![codecov](https://codecov.io/gh/jxnu-liguobin/scala-macro-tools/branch/master/graph/badge.svg?token=IA596YRTOT)](https://codecov.io/gh/jxnu-liguobin/scala-macro-tools)
[![Maven Central](https://img.shields.io/maven-central/v/io.github.jxnu-liguobin/scala-macro-tools_2.13.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.github.jxnu-liguobin%22%20AND%20a:%22scala-macro-tools_2.13%22)
[![Build](https://github.com/bitlap/scala-macro-tools/actions/workflows/ScalaCI.yml/badge.svg)](https://github.com/bitlap/scala-macro-tools/actions/workflows/ScalaCI.yml)
[![codecov](https://codecov.io/gh/bitlap/scala-macro-tools/branch/master/graph/badge.svg?token=IA596YRTOT)](https://codecov.io/gh/bitlap/scala-macro-tools)
[![Maven Central deprecated](https://img.shields.io/maven-central/v/io.github.jxnu-liguobin/scala-macro-tools_2.13.svg?label=Maven%20Central%20deprecated)](https://search.maven.org/search?q=g:%22io.github.jxnu-liguobin%22%20AND%20a:%22scala-macro-tools_2.13%22)
[![Maven Central](https://img.shields.io/maven-central/v/org.bitlap/scala-macro-tools_2.13.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22org.bitlap%22%20AND%20a:%22scala-macro-tools_2.13%22)
[![Version](https://img.shields.io/jetbrains/plugin/v/17202-scala-macro-tools)](https://plugins.jetbrains.com/plugin/17202-scala-macro-tools)
Motivation
......@@ -34,6 +35,7 @@ Learn Scala macro and abstract syntax tree.
- `@jacksonEnum`
- `@elapsed`
- `@JavaCompatible`
- `ProcessorCreator`
> The intellij plugin named `Scala-Macro-Tools` in marketplace.
......@@ -46,7 +48,7 @@ Learn Scala macro and abstract syntax tree.
Add library dependency
```scala
"io.github.jxnu-liguobin" %% "scala-macro-tools" % "<VERSION>"
"org.bitlap.tools" %% "scala-macro-tools" % "<VERSION>"
```
The artefacts have been uploaded to Maven Central. Importing the library into your build system (e.g gradle, sbt), is not enough. You need to follow an extra step.
......
<img align="right" width="30%" height="30%" src="img.png" alt="https://dreamylost.cn"/>
<img align="right" width="30%" height="30%" src="img.png" alt="https://bitlap.org"/>
# scala-macro-tools
[![Build](https://github.com/jxnu-liguobin/scala-macro-tools/actions/workflows/ScalaCI.yml/badge.svg)](https://github.com/jxnu-liguobin/scala-macro-tools/actions/workflows/ScalaCI.yml)
[![codecov](https://codecov.io/gh/jxnu-liguobin/scala-macro-tools/branch/master/graph/badge.svg?token=IA596YRTOT)](https://codecov.io/gh/jxnu-liguobin/scala-macro-tools)
[![Maven Central](https://img.shields.io/maven-central/v/io.github.jxnu-liguobin/scala-macro-tools_2.13.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.github.jxnu-liguobin%22%20AND%20a:%22scala-macro-tools_2.13%22)
[![Build](https://github.com/bitlap/scala-macro-tools/actions/workflows/ScalaCI.yml/badge.svg)](https://github.com/bitlap/scala-macro-tools/actions/workflows/ScalaCI.yml)
[![codecov](https://codecov.io/gh/bitlap/scala-macro-tools/branch/master/graph/badge.svg?token=IA596YRTOT)](https://codecov.io/gh/bitlap/scala-macro-tools)
[![Maven Central deprecated](https://img.shields.io/maven-central/v/io.github.jxnu-liguobin/scala-macro-tools_2.13.svg?label=Maven%20Central$20deprecated)](https://search.maven.org/search?q=g:%22io.github.jxnu-liguobin%22%20AND%20a:%22scala-macro-tools_2.13%22)
[![Maven Central](https://img.shields.io/maven-central/v/org.bitlap/scala-macro-tools_2.13.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22org.bitlap%22%20AND%20a:%22scala-macro-tools_2.13%22)
[![Version](https://img.shields.io/jetbrains/plugin/v/17202-scala-macro-tools)](https://plugins.jetbrains.com/plugin/17202-scala-macro-tools)
该库的目的
......@@ -34,6 +35,7 @@
- `@jacksonEnum`
- `@elapsed`
- `@JavaCompatible`
- `ProcessorCreator`
> Intellij插件 `Scala-Macro-Tools`。
......@@ -48,7 +50,7 @@
> 在gradle,maven中,通常`scala-macro-tools`被替换为`scala-macro-tools_2.12`这种。其中,`2.12`表示Scala版本号。
```scala
"io.github.jxnu-liguobin" %% "scala-macro-tools" % "<VERSION>"
"org.bitlap.tools" %% "scala-macro-tools" % "<VERSION>"
```
该库已发布到maven中央仓库,请使用最新版本。仅将本库导入构建系统(例如gradle、sbt)是不够的。你需要多走一步。
......
......@@ -2,7 +2,7 @@ import sbt.{ Def, Test }
import sbtrelease.ReleaseStateTransformations._
name := "scala-macro-tools"
organization := "io.github.jxnu-liguobin"
organization := "org.bitlap"
lazy val scala212 = "2.12.14"
lazy val scala211 = "2.11.12"
......@@ -33,9 +33,9 @@ lazy val root = (project in file("."))
case _ => List("-Ymacro-annotations" /*, "-Ymacro-debug-verbose"*/)
}
} ++ Seq("-language:experimental.macros"),
organizationName := "jxnu-liguobin && contributors",
organizationName := "org.bitlap",
startYear := Some(2021),
licenses += ("MIT", new URL("https://github.com/jxnu-liguobin/scala-macro-tools/blob/master/LICENSE")),
licenses += ("MIT", new URL("https://github.com/bitlap/scala-macro-tools/blob/master/LICENSE")),
Test / testOptions += Tests.Argument("-oDF"),
Test / fork := true,
// Test / classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.ScalaLibrary,
......
package io.github.dreamylost
package org.bitlap.tools
import io.github.dreamylost.toString
import io.github.dreamylost.builder
import io.github.dreamylost.apply
/**
*
......
import org.jetbrains.sbtidea.Keys._
name := "scala-macro-tools-intellij-plugin"
organization := "io.github.jxnu-liguobin"
organization := "org.bitlap.tools"
lazy val scala213 = "2.13.6"
......
......@@ -18,13 +18,13 @@
<resource-bundle>messages.PluginBundle</resource-bundle>
<extensions defaultExtensionNs="com.intellij">
<applicationService serviceImplementation="io.github.dreamylost.plugin.ScalaMacroProcessorProvider" />
<!-- <lang.psiAugmentProvider implementation="io.github.dreamylost.plugin.ScalaMacroAugmentProvider"/> -->
<applicationService serviceImplementation="org.bitlap.tools.plugin.ScalaMacroProcessorProvider" />
<!-- <lang.psiAugmentProvider implementation="org.bitlap.tools.plugin.ScalaMacroAugmentProvider"/> -->
<notificationGroup displayType="BALLOON" id="Scala-Macro-Tools Plugin" />
</extensions>
<extensions defaultExtensionNs="org.intellij.scala">
<syntheticMemberInjector implementation="io.github.dreamylost.plugin.ScalaMacroInjector"/>
<syntheticMemberInjector implementation="org.bitlap.tools.plugin.ScalaMacroInjector"/>
</extensions>
</idea-plugin>
......@@ -16,5 +16,5 @@ hello.from.project.getname=Hello from project "{0}"!
my.cool.tool.window=My Cool Tool Window
### resources/META-INF/plugin.xml
action.io.github.dreamylost.plugin.PopupDialogAction.text=Action Basics Plugin: Pop Dialog Action
action.io.github.dreamylost.plugin.PopupDialogAction.description=SDK action example
action.org.bitlap.tools.plugin.PopupDialogAction.text=Action Basics Plugin: Pop Dialog Action
action.org.bitlap.tools.plugin.PopupDialogAction.description=SDK action example
<![CDATA[
<h1>Scala Macro Tools plugin for IntelliJ IDEA</h1>
<br/>
<a href="https://github.com/jxnu-liguobin/scala-macro-tools">GitHub</a> |
<a href="https://github.com/jxnu-liguobin/scala-macro-tools/issues">Issues</a>
<a href="https://github.com/bitlap/scala-macro-tools">GitHub</a> |
<a href="https://github.com/bitlap/scala-macro-tools/issues">Issues</a>
<br/>
<br/>
<b>A plugin that implements Lombok-like functionality with Scala macros</b>
......
package io.github.dreamylost.plugin
package org.bitlap.tools.plugin
import com.intellij.DynamicBundle
import org.jetbrains.annotations.{ NotNull, PropertyKey }
......
package io.github.dreamylost.plugin
package org.bitlap.tools.plugin
import com.intellij.openapi.components.ServiceManager
import io.github.dreamylost.plugin.processor.ProcessType
import io.github.dreamylost.plugin.processor.ProcessType.ProcessType
import org.bitlap.tools.plugin.processor.ProcessType
import org.bitlap.tools.plugin.processor.ProcessType.ProcessType
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScTypeDefinition
import org.jetbrains.plugins.scala.lang.psi.impl.toplevel.typedef.SyntheticMembersInjector
/**
......
package io.github.dreamylost.plugin
package org.bitlap.tools.plugin
/**
* Mail: chk19940609@gmail.com
......@@ -7,7 +7,7 @@ package io.github.dreamylost.plugin
*/
object ScalaMacroNames {
private val NS = "io.github.dreamylost"
private val NS = "org.bitlap.tools"
val BUILDER = s"$NS.builder"
val LOG = s"$NS.log"
val APPLY = s"$NS.apply"
......
package io.github.dreamylost.plugin
package org.bitlap.tools.plugin
import com.intellij.openapi.Disposable
import io.github.dreamylost.plugin.processor.Processor
import io.github.dreamylost.plugin.processor.clazz.{ ApplyProcessor, BuilderProcessor, ConstructorProcessor, EqualsAndHashCodeProcessor, JsonProcessor, LogProcessor }
import org.bitlap.tools.plugin.processor.Processor
import org.bitlap.tools.plugin.processor.clazz.{ ApplyProcessor, BuilderProcessor, ConstructorProcessor, EqualsAndHashCodeProcessor, JsonProcessor, LogProcessor }
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.{ ScClass, ScObject, ScTypeDefinition }
import scala.collection.mutable
......
package io.github.dreamylost.plugin.processor
package org.bitlap.tools.plugin.processor
import org.jetbrains.plugins.scala.lang.psi.api.base.ScMethodLike
import org.jetbrains.plugins.scala.lang.psi.api.statements.params.ScClassParameter
......
package io.github.dreamylost.plugin.processor
package org.bitlap.tools.plugin.processor
import io.github.dreamylost.plugin.processor.ProcessType.ProcessType
import org.bitlap.tools.plugin.processor.ProcessType.ProcessType
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScTypeDefinition
/**
......
package io.github.dreamylost.plugin.processor.clazz
package org.bitlap.tools.plugin.processor.clazz
import io.github.dreamylost.plugin.processor.ProcessType.ProcessType
import io.github.dreamylost.plugin.processor.{ AbsProcessor, ProcessType }
import org.bitlap.tools.plugin.processor.ProcessType.ProcessType
import org.bitlap.tools.plugin.processor.{ AbsProcessor, ProcessType }
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.{ ScClass, ScObject, ScTypeDefinition }
/**
......
package io.github.dreamylost.plugin.processor.clazz
package org.bitlap.tools.plugin.processor.clazz
import io.github.dreamylost.plugin.processor.{ AbsProcessor, ProcessType }
import io.github.dreamylost.plugin.processor.ProcessType.ProcessType
import org.bitlap.tools.plugin.processor.{ AbsProcessor, ProcessType }
import org.bitlap.tools.plugin.processor.ProcessType.ProcessType
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.{ ScClass, ScObject, ScTypeDefinition }
/**
......
package io.github.dreamylost.plugin.processor.clazz
package org.bitlap.tools.plugin.processor.clazz
import io.github.dreamylost.plugin.ScalaMacroNames
import io.github.dreamylost.plugin.processor.ProcessType.ProcessType
import io.github.dreamylost.plugin.processor.{ AbsProcessor, ProcessType }
import org.bitlap.tools.plugin.ScalaMacroNames
import org.bitlap.tools.plugin.processor.ProcessType.ProcessType
import org.bitlap.tools.plugin.processor.{ AbsProcessor, ProcessType }
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScMethodCall
import org.jetbrains.plugins.scala.lang.psi.api.statements.ScVariableDefinition
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.{ ScClass, ScTypeDefinition }
......
package io.github.dreamylost.plugin.processor.clazz
package org.bitlap.tools.plugin.processor.clazz
import io.github.dreamylost.plugin.processor.ProcessType.ProcessType
import io.github.dreamylost.plugin.processor.{ AbsProcessor, ProcessType }
import org.bitlap.tools.plugin.processor.ProcessType.ProcessType
import org.bitlap.tools.plugin.processor.{ AbsProcessor, ProcessType }
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.{ ScClass, ScTypeDefinition }
/**
......
package io.github.dreamylost.plugin.processor.clazz
package org.bitlap.tools.plugin.processor.clazz
import io.github.dreamylost.plugin.processor.ProcessType.ProcessType
import io.github.dreamylost.plugin.processor.{ AbsProcessor, ProcessType }
import org.bitlap.tools.plugin.processor.ProcessType.ProcessType
import org.bitlap.tools.plugin.processor.{ AbsProcessor, ProcessType }
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.{ ScObject, ScTypeDefinition }
/**
......
package io.github.dreamylost.plugin.processor.clazz
package org.bitlap.tools.plugin.processor.clazz
import io.github.dreamylost.plugin.ScalaMacroNames
import io.github.dreamylost.plugin.processor.ProcessType.ProcessType
import io.github.dreamylost.plugin.processor.{ AbsProcessor, ProcessType }
import org.bitlap.tools.plugin.ScalaMacroNames
import org.bitlap.tools.plugin.processor.ProcessType.ProcessType
import org.bitlap.tools.plugin.processor.{ AbsProcessor, ProcessType }
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.{ ScClass, ScObject, ScTypeDefinition }
/**
......
......@@ -34,11 +34,11 @@ object Publishing {
)),
sonatypeProfileName := organization.value,
isSnapshot := version.value endsWith "SNAPSHOT",
homepage := Some(url("https://github.com/jxnu-liguobin")),
homepage := Some(url("https://bitlap.org")),
scmInfo := Some(
ScmInfo(
url("https://github.com/jxnu-liguobin/scala-macro-tools"),
"scm:git@github.com:jxnu-liguobin/scala-macro-tools.git"
url("https://github.com/bitlap/scala-macro-tools"),
"scm:git@github.com:bitlap/scala-macro-tools.git"
))
)
}
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,10 +19,10 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import scala.annotation.{ compileTimeOnly, StaticAnnotation }
import io.github.dreamylost.macros.javaCompatibleMacro
import org.bitlap.tools.macros.javaCompatibleMacro
/**
* annotation to generate non-parameter constructor and get/set method for case classes.
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
/**
* Log Level for elapsed
......@@ -33,7 +33,7 @@ object LogLevel extends Enumeration {
type LogLevel = Value
val INFO, WARN, DEBUG = Value
private[dreamylost] def getLogLevel(shortType: String): LogLevel = {
private[bitlap] def getLogLevel(shortType: String): LogLevel = {
val tpe1 = s"$PACKAGE.elapsed.$shortType" //LogLevel.INFO
val tpe2 = s"$PACKAGE.elapsed.LogLevel.$shortType" // INFO
val v = LogLevel.values.find(p => {
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,9 +19,9 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import io.github.dreamylost.macros.ProcessorCreatorMacro
import org.bitlap.tools.macros.ProcessorCreatorMacro
import java.util.concurrent.Executor
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,9 +19,9 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import io.github.dreamylost.macros.applyMacro
import org.bitlap.tools.macros.applyMacro
import scala.annotation.{ StaticAnnotation, compileTimeOnly }
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,9 +19,9 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import io.github.dreamylost.macros.builderMacro
import org.bitlap.tools.macros.builderMacro
import scala.annotation.{ StaticAnnotation, compileTimeOnly }
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,9 +19,9 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import io.github.dreamylost.macros.constructorMacro
import org.bitlap.tools.macros.constructorMacro
import scala.annotation.{ StaticAnnotation, compileTimeOnly }
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,10 +19,10 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import LogLevel.LogLevel
import io.github.dreamylost.macros.elapsedMacro
import org.bitlap.tools.LogLevel.LogLevel
import org.bitlap.tools.macros.elapsedMacro.ElapsedProcessor
import scala.annotation.{ StaticAnnotation, compileTimeOnly }
import scala.concurrent.duration.Duration
......@@ -39,6 +39,6 @@ import scala.concurrent.duration.Duration
@compileTimeOnly("enable macro to expand macro annotations")
final class elapsed(limit: Duration, logLevel: LogLevel) extends StaticAnnotation {
def macroTransform(annottees: Any*): Any = macro elapsedMacro.ElapsedProcessor.impl
def macroTransform(annottees: Any*): Any = macro ElapsedProcessor.impl
}
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,9 +19,9 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import io.github.dreamylost.macros.equalsAndHashCodeMacro
import org.bitlap.tools.macros.equalsAndHashCodeMacro.EqualsAndHashCodeProcessor
import scala.annotation.{ StaticAnnotation, compileTimeOnly }
......@@ -40,5 +40,5 @@ final class equalsAndHashCode(
excludeFields: Seq[String] = Nil
) extends StaticAnnotation {
def macroTransform(annottees: Any*): Any = macro equalsAndHashCodeMacro.EqualsAndHashCodeProcessor.impl
def macroTransform(annottees: Any*): Any = macro EqualsAndHashCodeProcessor.impl
}
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,11 +19,11 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import io.github.dreamylost.macros.jacksonEnumMacro
import org.bitlap.tools.macros.jacksonEnumMacro
import scala.annotation.{ compileTimeOnly, StaticAnnotation }
import scala.annotation.{ StaticAnnotation, compileTimeOnly }
/**
* annotation to generate equals and hashcode method for classes.
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,9 +19,9 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import io.github.dreamylost.macros.jsonMacro
import org.bitlap.tools.macros.jsonMacro
import scala.annotation.{ StaticAnnotation, compileTimeOnly }
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,12 +19,12 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import io.github.dreamylost.logs._
import io.github.dreamylost.macros.logMacro
import org.bitlap.tools.logs.LogType
import org.bitlap.tools.macros.logMacro
import scala.annotation.{ StaticAnnotation, compileTimeOnly }
import scala.annotation.{ compileTimeOnly, StaticAnnotation }
/**
* annotation to generate log.
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,9 +19,9 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.logs
package org.bitlap.tools.logs
import io.github.dreamylost.logs.LogType.LogType
import org.bitlap.tools.logs.LogType.LogType
import scala.reflect.macros.whitebox
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,9 +19,9 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.logs
package org.bitlap.tools.logs
import io.github.dreamylost.logs.LogType.LogType
import org.bitlap.tools.logs.LogType.LogType
import scala.reflect.macros.whitebox
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,9 +19,9 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.logs
package org.bitlap.tools.logs
import io.github.dreamylost.logs.LogType.LogType
import org.bitlap.tools.logs.LogType.LogType
import scala.reflect.macros.whitebox
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.logs
package org.bitlap.tools.logs
/**
*
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,10 +19,10 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.logs
package org.bitlap.tools.logs
import io.github.dreamylost.PACKAGE
import io.github.dreamylost.logs.extension.{ ScalaLoggingLazyImpl, ScalaLoggingStrictImpl }
import org.bitlap.tools.PACKAGE
import org.bitlap.tools.logs.extension.{ ScalaLoggingLazyImpl, ScalaLoggingStrictImpl }
object LogType extends Enumeration {
......@@ -37,11 +37,11 @@ object LogType extends Enumeration {
ScalaLoggingLazy -> ScalaLoggingLazyImpl
)
private[dreamylost] def getLogImpl(logType: LogType): BaseLog = {
def getLogImpl(logType: LogType): BaseLog = {
types.getOrElse(logType, default = throw new Exception(s"Not support log type: $logType"))
}
private[dreamylost] def getLogType(shortType: String): LogType = {
def getLogType(shortType: String): LogType = {
val tpe1 = s"$PACKAGE.logs.$shortType" //LogType.JLog
val tpe2 = s"$PACKAGE.logs.LogType.$shortType" // JLog
val v = LogType.values.find(p => {
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,9 +19,9 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.logs
package org.bitlap.tools.logs
import io.github.dreamylost.logs.LogType.LogType
import org.bitlap.tools.logs.LogType.LogType
import scala.reflect.macros.whitebox
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.logs.extension
package org.bitlap.tools.logs.extension
import org.slf4j.LoggerFactory
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,10 +19,10 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.logs.extension
package org.bitlap.tools.logs.extension
import io.github.dreamylost.logs.LogType.LogType
import io.github.dreamylost.logs.{ BaseLog, LogTransferArgument, LogType }
import org.bitlap.tools.logs.LogType.LogType
import org.bitlap.tools.logs.{ BaseLog, LogTransferArgument, LogType }
import scala.reflect.macros.whitebox
......@@ -39,6 +39,6 @@ object ScalaLoggingLazyImpl extends BaseLog {
override def getTemplate(c: whitebox.Context)(logTransferArgument: LogTransferArgument): c.Tree = {
import c.universe._
tq"_root_.io.github.dreamylost.logs.extension.ScalaLazyLogging"
tq"_root_.org.bitlap.tools.logs.extension.ScalaLazyLogging"
}
}
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,10 +19,10 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.logs.extension
package org.bitlap.tools.logs.extension
import io.github.dreamylost.logs.LogType.LogType
import io.github.dreamylost.logs.{ BaseLog, LogTransferArgument, LogType }
import org.bitlap.tools.logs.LogType.LogType
import org.bitlap.tools.logs.{ BaseLog, LogTransferArgument, LogType }
import scala.reflect.macros.whitebox
......@@ -39,6 +39,6 @@ object ScalaLoggingStrictImpl extends BaseLog {
override def getTemplate(c: whitebox.Context)(logTransferArgument: LogTransferArgument): c.Tree = {
import c.universe._
tq"_root_.io.github.dreamylost.logs.extension.ScalaStrictLogging"
tq"_root_.org.bitlap.tools.logs.extension.ScalaStrictLogging"
}
}
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.logs.extension
package org.bitlap.tools.logs.extension
import org.slf4j.LoggerFactory
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.macros
package org.bitlap.tools.macros
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
......@@ -358,10 +358,10 @@ abstract class AbstractMacroProcessor(val c: whitebox.Context) {
}
/**
* Retrieves the accessor fields on a class and returns a Seq of [[io.github.dreamylost.macros.AbstractMacroProcessor#ValDefAccessor]].
* Retrieves the accessor fields on a class and returns a Seq of [[org.bitlap.tools.macros.AbstractMacroProcessor#ValDefAccessor]].
*
* @param params The list of params retrieved from the class
* @return Return a sequence of [[io.github.dreamylost.macros.AbstractMacroProcessor#ValDefAccessor]]
* @return Return a sequence of [[org.bitlap.tools.macros.AbstractMacroProcessor#ValDefAccessor]]
*/
def valDefAccessors(params: Seq[Tree]): Seq[ValDefAccessor] = {
params.map {
......@@ -374,7 +374,7 @@ abstract class AbstractMacroProcessor(val c: whitebox.Context) {
* Extract the necessary structure information of the class for macro programming.
*
* @param classDecl
* @return Return the expansion of the class definition as [[io.github.dreamylost.macros.AbstractMacroProcessor#ClassDefinition]]
* @return Return the expansion of the class definition as [[org.bitlap.tools.macros.AbstractMacroProcessor#ClassDefinition]]
*/
def mapToClassDeclInfo(classDecl: ClassDef): ClassDefinition = {
val q"$mods class $tpname[..$tparams] $ctorMods(...$paramss) extends { ..$earlydefns } with ..$parents { $self => ..$stats }" = classDecl
......@@ -387,7 +387,7 @@ abstract class AbstractMacroProcessor(val c: whitebox.Context) {
* Extract the necessary structure information of the moduleDef for macro programming.
*
* @param moduleDef
* @return Return the expansion of the class definition as [[io.github.dreamylost.macros.AbstractMacroProcessor#ClassDefinition]]
* @return Return the expansion of the class definition as [[org.bitlap.tools.macros.AbstractMacroProcessor#ClassDefinition]]
*/
def mapToModuleDeclInfo(moduleDef: ModuleDef): ClassDefinition = {
val q"$mods object $tpname extends { ..$earlydefns } with ..$parents { $self => ..$stats }" = moduleDef
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.macros
package org.bitlap.tools.macros
import scala.reflect.runtime.currentMirror
import scala.reflect.runtime.universe._
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.macros
package org.bitlap.tools.macros
object MacroCache {
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.macros
package org.bitlap.tools.macros
import scala.reflect.macros.blackbox
import java.time.ZonedDateTime
......@@ -165,7 +165,7 @@ object ProcessorCreatorMacro {
$processException(service, rpcCtx, exception)
}
}
val service = new io.github.dreamylost.macros.Creator[$serviceType].createInstance(null)(0)
val service = new org.bitlap.tools.macros.Creator[$serviceType].createInstance(null)(0)
new $className(service)
"""
printTree[RRP](c)(processor)
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.macros
package org.bitlap.tools.macros
import scala.reflect.macros.whitebox
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.macros
package org.bitlap.tools.macros
import scala.reflect.macros.whitebox
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.macros
package org.bitlap.tools.macros
import scala.reflect.macros.whitebox
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,10 +19,10 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.macros
package org.bitlap.tools.macros
import io.github.dreamylost.LogLevel.LogLevel
import io.github.dreamylost.{ LogLevel, PACKAGE }
import org.bitlap.tools.LogLevel.LogLevel
import org.bitlap.tools.{ LogLevel, PACKAGE }
import scala.concurrent.duration._
import scala.reflect.macros.whitebox
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.macros
package org.bitlap.tools.macros
import scala.reflect.macros.whitebox
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.macros
package org.bitlap.tools.macros
import scala.reflect.macros.whitebox
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.macros
package org.bitlap.tools.macros
import scala.reflect.macros.whitebox
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.macros
package org.bitlap.tools.macros
import scala.reflect.macros.whitebox
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,11 +19,11 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.macros
package org.bitlap.tools.macros
import io.github.dreamylost.logs.LogType._
import io.github.dreamylost.logs.{ LogTransferArgument, LogType }
import io.github.dreamylost.{ PACKAGE, logs }
import org.bitlap.tools.logs.LogType._
import org.bitlap.tools.logs.{ LogTransferArgument, LogType }
import org.bitlap.tools.{ PACKAGE, logs }
import scala.reflect.macros.whitebox
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
/**
*
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.macros
package org.bitlap.tools.macros
import scala.reflect.macros.whitebox
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost.macros
package org.bitlap.tools.macros
import scala.reflect.macros.whitebox
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github
package org.bitlap
/**
*
......@@ -27,6 +27,6 @@ package io.github
* @since 2021/7/7
* @version 1.0
*/
package object dreamylost {
final val PACKAGE = "io.github.dreamylost"
package object tools {
final val PACKAGE = "org.bitlap.tools"
}
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,9 +19,9 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import io.github.dreamylost.macros.synchronizedMacro
import org.bitlap.tools.macros.synchronizedMacro.SynchronizedProcessor
import scala.annotation.{ StaticAnnotation, compileTimeOnly }
......@@ -39,5 +39,6 @@ final class synchronized(
verbose: Boolean = false,
lockedName: String = "this"
) extends StaticAnnotation {
def macroTransform(annottees: Any*): Any = macro synchronizedMacro.SynchronizedProcessor.impl
def macroTransform(annottees: Any*): Any = macro SynchronizedProcessor.impl
}
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,9 +19,9 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import io.github.dreamylost.macros.toStringMacro
import org.bitlap.tools.macros.toStringMacro
import scala.annotation.{ StaticAnnotation, compileTimeOnly }
......@@ -43,5 +43,6 @@ final class toString(
includeFieldNames: Boolean = true,
callSuper: Boolean = false
) extends StaticAnnotation {
def macroTransform(annottees: Any*): Any = macro toStringMacro.ToStringProcessor.impl
}
//Test for Processable and ProcessorCreator
syntax = "proto3";
option java_package = "io.github.dreamylost.test.proto";
option java_package = "org.bitlap.tools.test.proto";
option java_multiple_files = true;
option java_outer_classname = "DriverService";
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
......@@ -38,7 +38,7 @@ class BuilderTest extends AnyFlatSpec with Matchers {
// field : <caseaccessor> <paramaccessor> val i: Int = 0, so default value is "_"
val ret = TestClass1.builder().i(1).j(0).x("x").build()
println(ret)
assert(TestClass1.builder().getClass.getTypeName == "io.github.dreamylost.BuilderTest$TestClass1$2$TestClass1Builder")
assert(TestClass1.builder().getClass.getTypeName == "org.bitlap.tools.BuilderTest$TestClass1$2$TestClass1Builder")
assert(ret.toString == "TestClass1(1,0,x,Some())")
}
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
......@@ -32,7 +32,7 @@ import org.scalatest.matchers.should.Matchers
*/
class CreatorTest extends AnyFlatSpec with Matchers {
"Creator" should "ok" in {
val service = new io.github.dreamylost.macros.Creator[NetService]().createInstance(null)(0)
val service = new org.bitlap.tools.macros.Creator[NetService]().createInstance(null)(0)
println(service.openSession("1", "2"))
}
}
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
......@@ -38,22 +38,22 @@ class ElapsedTest extends AnyFlatSpec with Matchers {
//Duration and TimeUnit must Full class name
"""
| class A {
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.INFO)
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.INFO)
| def i = ???
| }
|
| class B {
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.WARN)
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.WARN)
| def j = ???
| }
|
| class C {
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.DEBUG)
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.DEBUG)
| def j = ???
| }
|
| class D {
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.INFO)
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.INFO)
| def i:String = ???
| }
| val a = new A()
......@@ -67,13 +67,13 @@ class ElapsedTest extends AnyFlatSpec with Matchers {
//Duration and TimeUnit must Full class name
"""
|class A {
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.NANOSECONDS), logLevel = io.github.dreamylost.LogLevel.INFO)
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.NANOSECONDS), logLevel = org.bitlap.tools.LogLevel.INFO)
| def helloWorld: String = {
| println("hello world")
| "hello"
| }
|
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.INFO)
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.INFO)
| def helloScala: String = {
| Thread.sleep(2000)
| println("hello world")
......@@ -90,18 +90,18 @@ class ElapsedTest extends AnyFlatSpec with Matchers {
//Duration and TimeUnit must Full class name
"""
| class A {
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.NANOSECONDS), logLevel = io.github.dreamylost.LogLevel.INFO)
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.NANOSECONDS), logLevel = org.bitlap.tools.LogLevel.INFO)
| def helloWorld: String = {
| println("") ; println(""); ""
| }
|
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.INFO)
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.INFO)
| def helloScala1: String = { println("") ; println(""); ""}
|
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.INFO)
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.INFO)
| def helloScala2: String = { println("") ; println(""); "" }
|
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.INFO)
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.INFO)
| def helloScala3: String = {
| val s = "hello"
| val x = "world"
......@@ -116,7 +116,7 @@ class ElapsedTest extends AnyFlatSpec with Matchers {
//Duration and TimeUnit must Full class name
"""
| class A {
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.INFO)
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.INFO)
| def helloScala1: String = {
| val s = "hello"
| if (s == "hello") {
......@@ -131,7 +131,7 @@ class ElapsedTest extends AnyFlatSpec with Matchers {
| a.helloScala1
|
| class B {
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.INFO)
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.INFO)
| def helloScala11: String = {
| val s = "hello"
| if (s == "hello") {
......@@ -151,13 +151,13 @@ class ElapsedTest extends AnyFlatSpec with Matchers {
private final val log3: org.slf4j.Logger = org.slf4j.LoggerFactory.getLogger(classOf[A])
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.INFO)
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.INFO)
def helloScala1: Future[String] = {
Thread.sleep(1000)
Future.successful("hello world")
}
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.DEBUG)
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.DEBUG)
def helloScala2: Future[String] = {
Thread.sleep(2000)
Future {
......@@ -165,7 +165,7 @@ class ElapsedTest extends AnyFlatSpec with Matchers {
}(scala.concurrent.ExecutionContext.Implicits.global)
}
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.WARN)
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.WARN)
def helloScala3: Future[String] = Future {
"hello world"
}(scala.concurrent.ExecutionContext.Implicits.global)
......@@ -178,15 +178,15 @@ class ElapsedTest extends AnyFlatSpec with Matchers {
import scala.concurrent.Await
import scala.concurrent.duration.Duration
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.WARN)
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.WARN)
def helloScala(t: String): Future[String] = {
Future(t)(scala.concurrent.ExecutionContext.Implicits.global)
}
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.WARN)
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.WARN)
def helloScala11(t: String): Future[String] = Future(t)(scala.concurrent.ExecutionContext.Implicits.global)
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.INFO)
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.INFO)
def helloScala2: String = {
val s = Future("")(scala.concurrent.ExecutionContext.Implicits.global)
Await.result(helloScala("world"), Duration.Inf)
......@@ -199,13 +199,13 @@ class ElapsedTest extends AnyFlatSpec with Matchers {
| object A {
| private final val log1: org.slf4j.Logger = org.slf4j.LoggerFactory.getLogger(A.getClass)
|
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.INFO)
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.INFO)
| def helloScala1: Future[String] = {
| Thread.sleep(1000)
| Future.successful("hello world")
| }
|
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.DEBUG)
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.DEBUG)
| def helloScala2: Future[String] = {
| Thread.sleep(2000)
| Future {
......@@ -213,7 +213,7 @@ class ElapsedTest extends AnyFlatSpec with Matchers {
| }(scala.concurrent.ExecutionContext.Implicits.global)
| }
|
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.WARN)
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.WARN)
| def helloScala3: Future[String] = Future {
| "hello world"
| }(scala.concurrent.ExecutionContext.Implicits.global)
......@@ -228,7 +228,7 @@ class ElapsedTest extends AnyFlatSpec with Matchers {
println("")
"hello"
}
import io.github.dreamylost.LogLevel.WARN
import org.bitlap.tools.LogLevel.WARN
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = WARN)
def helloScala2: String = {
println("")
......@@ -236,7 +236,7 @@ class ElapsedTest extends AnyFlatSpec with Matchers {
"hello"
}
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.WARN)
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.WARN)
def helloScala3: String = {
println("")
println("")
......@@ -246,7 +246,7 @@ class ElapsedTest extends AnyFlatSpec with Matchers {
"elapsed9" should "failed at input args" in {
"""
|@elapsed(logLevel = io.github.dreamylost.LogLevel.WARN, limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS))
|@elapsed(logLevel = org.bitlap.tools.LogLevel.WARN, limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS))
| def helloScala1: String = {
| println("")
| println("")
......@@ -257,7 +257,7 @@ class ElapsedTest extends AnyFlatSpec with Matchers {
"elapsed10" should "multi-return" in {
class A {
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.INFO)
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.INFO)
def j: Int = {
var i = 1
if (i == 1) {
......@@ -277,7 +277,7 @@ class ElapsedTest extends AnyFlatSpec with Matchers {
i
}
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.INFO)
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.INFO)
def k: Unit = {
var i = 1
if (i == 1) {
......@@ -309,7 +309,7 @@ class ElapsedTest extends AnyFlatSpec with Matchers {
1
}
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.INFO)
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.INFO)
def l: Int = {
val i = 0
for (i <- Seq(1)) {
......@@ -320,7 +320,7 @@ class ElapsedTest extends AnyFlatSpec with Matchers {
0
}
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.INFO)
@elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.INFO)
def m: Int = {
var i = 1
if (i == 1) {
......@@ -345,7 +345,7 @@ class ElapsedTest extends AnyFlatSpec with Matchers {
"elapsed11" should "failed at abstract method" in {
"""
|abstract class A {
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = io.github.dreamylost.LogLevel.WARN)
| @elapsed(limit = scala.concurrent.duration.Duration(1, java.util.concurrent.TimeUnit.SECONDS), logLevel = org.bitlap.tools.LogLevel.WARN)
| def hello:String
| }
|""".stripMargin shouldNot compile
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import com.fasterxml.jackson.module.scala.JsonScalaEnumeration
import org.scalatest.flatspec.AnyFlatSpec
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import play.api.libs.json.Json
import org.scalatest.flatspec.AnyFlatSpec
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
/**
*
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,9 +19,9 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import io.github.dreamylost.logs.LogType
import org.bitlap.tools.logs.LogType
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
......@@ -41,8 +41,8 @@ class LogTest extends AnyFlatSpec with Matchers {
"""@log class TestClass2(val i: Int = 0, var j: Int)""" should compile
"""@log() class TestClass3(val i: Int = 0, var j: Int)""" should compile
"""@log(verbose=true) class TestClass4(val i: Int = 0, var j: Int)""" should compile
"""@log(logType=io.github.dreamylost.logs.LogType.JLog) class TestClass5(val i: Int = 0, var j: Int)""" should compile
"""@log(verbose=true, logType=io.github.dreamylost.logs.LogType.JLog) class TestClass6(val i: Int = 0, var j: Int)""" should compile
"""@log(logType=org.bitlap.tools.logs.LogType.JLog) class TestClass5(val i: Int = 0, var j: Int)""" should compile
"""@log(verbose=true, logType=org.bitlap.tools.logs.LogType.JLog) class TestClass6(val i: Int = 0, var j: Int)""" should compile
}
"log3" should "ok on object" in {
......@@ -53,8 +53,8 @@ class LogTest extends AnyFlatSpec with Matchers {
"""@log object TestClass2""" should compile
"""@log() object TestClass3""" should compile
"""@log(verbose=true) object TestClass4""" should compile
"""@log(logType=io.github.dreamylost.logs.LogType.JLog) object TestClass5""" should compile
"""@log(verbose=true, logType=io.github.dreamylost.logs.LogType.JLog) object TestClass6""" should compile
"""@log(logType=org.bitlap.tools.logs.LogType.JLog) object TestClass5""" should compile
"""@log(verbose=true, logType=org.bitlap.tools.logs.LogType.JLog) object TestClass6""" should compile
}
"log4 log4j2" should "ok on object" in {
......@@ -65,8 +65,8 @@ class LogTest extends AnyFlatSpec with Matchers {
"""@log object TestClass2""" should compile
"""@log() object TestClass3""" should compile
"""@log(verbose=true) object TestClass4""" should compile
"""@log(logType=io.github.dreamylost.logs.LogType.Log4j2) object TestClass5""" should compile
"""@log(verbose=true, logType=io.github.dreamylost.logs.LogType.Log4j2) object TestClass6""" should compile
"""@log(logType=org.bitlap.tools.logs.LogType.Log4j2) object TestClass5""" should compile
"""@log(verbose=true, logType=org.bitlap.tools.logs.LogType.Log4j2) object TestClass6""" should compile
}
"log5 slf4j" should "ok on object" in {
......@@ -77,8 +77,8 @@ class LogTest extends AnyFlatSpec with Matchers {
"""@log object TestClass2""" should compile
"""@log() object TestClass3""" should compile
"""@log(verbose=true) object TestClass4""" should compile
"""@log(logType=io.github.dreamylost.logs.LogType.Slf4j) object TestClass5""" should compile
"""@log(verbose=true, logType=io.github.dreamylost.logs.LogType.Slf4j) object TestClass6""" should compile
"""@log(logType=org.bitlap.tools.logs.LogType.Slf4j) object TestClass5""" should compile
"""@log(verbose=true, logType=org.bitlap.tools.logs.LogType.Slf4j) object TestClass6""" should compile
}
"log6 log4j2" should "ok on class" in {
......@@ -89,8 +89,8 @@ class LogTest extends AnyFlatSpec with Matchers {
"""@log class TestClass2(val i: Int = 0, var j: Int)""" should compile
"""@log() class TestClass3(val i: Int = 0, var j: Int)""" should compile
"""@log(verbose=true) class TestClass4(val i: Int = 0, var j: Int)""" should compile
"""@log(logType=io.github.dreamylost.logs.LogType.Log4j2) class TestClass5(val i: Int = 0, var j: Int)""" should compile
"""@log(verbose=true, logType=io.github.dreamylost.logs.LogType.Log4j2) class TestClass6(val i: Int = 0, var j: Int)""" should compile
"""@log(logType=org.bitlap.tools.logs.LogType.Log4j2) class TestClass5(val i: Int = 0, var j: Int)""" should compile
"""@log(verbose=true, logType=org.bitlap.tools.logs.LogType.Log4j2) class TestClass6(val i: Int = 0, var j: Int)""" should compile
}
"log7 slf4j" should "ok on class" in {
......@@ -101,10 +101,10 @@ class LogTest extends AnyFlatSpec with Matchers {
"""@toString @builder @log class TestClass2(val i: Int = 0, var j: Int)""" should compile //Use with multiple annotations
"""@log() class TestClass3(val i: Int = 0, var j: Int)""" should compile
"""@log(verbose=true) class TestClass4(val i: Int = 0, var j: Int)""" should compile
"""@log(logType=io.github.dreamylost.logs.LogType.Slf4j) class TestClass5(val i: Int = 0, var j: Int)""" should compile
"""@log(verbose=true, logType=io.github.dreamylost.logs.LogType.Slf4j) class TestClass6(val i: Int = 0, var j: Int)""" should compile
"""@log(verbose=true, logType=io.github.dreamylost.logs.LogType.Slf4j) class TestClass6(val i: Int = 0, var j: Int){ log.info("hello world") }""" should compile
"""@log(logType = io.github.dreamylost.logs.LogType.Slf4j) class TestClass6(val i: Int = 0, var j: Int){ log.info("hello world") }""" should compile //default verbose is false
"""@log(logType=org.bitlap.tools.logs.LogType.Slf4j) class TestClass5(val i: Int = 0, var j: Int)""" should compile
"""@log(verbose=true, logType=org.bitlap.tools.logs.LogType.Slf4j) class TestClass6(val i: Int = 0, var j: Int)""" should compile
"""@log(verbose=true, logType=org.bitlap.tools.logs.LogType.Slf4j) class TestClass6(val i: Int = 0, var j: Int){ log.info("hello world") }""" should compile
"""@log(logType = org.bitlap.tools.logs.LogType.Slf4j) class TestClass6(val i: Int = 0, var j: Int){ log.info("hello world") }""" should compile //default verbose is false
}
"log8 slf4j" should "ok on class and has object" in {
......@@ -115,13 +115,13 @@ class LogTest extends AnyFlatSpec with Matchers {
"""@toString @builder @log class TestClass2(val i: Int = 0, var j: Int)""" should compile //Use with multiple annotations
"""@log() class TestClass3(val i: Int = 0, var j: Int)""" should compile
"""@log(verbose=true) class TestClass4(val i: Int = 0, var j: Int)""" should compile
"""@log(logType=io.github.dreamylost.logs.LogType.Slf4j) class TestClass5(val i: Int = 0, var j: Int)""" should compile
"""@log(verbose=true, logType=io.github.dreamylost.logs.LogType.Slf4j) class TestClass6(val i: Int = 0, var j: Int)""" should compile
"""@log(verbose=true, logType=io.github.dreamylost.logs.LogType.Slf4j) class TestClass6(val i: Int = 0, var j: Int){ log.info("hello world") }""" should compile
"""@log(logType = io.github.dreamylost.logs.LogType.Slf4j) @builder class TestClass6(val i: Int = 0, var j: Int){ log.info("hello world") }
| @log(logType = io.github.dreamylost.logs.LogType.Slf4j) object TestClass6 { log.info("hello world");builder() }""".stripMargin should compile //default verbose is false
"""@log(logType=org.bitlap.tools.logs.LogType.Slf4j) class TestClass5(val i: Int = 0, var j: Int)""" should compile
"""@log(verbose=true, logType=org.bitlap.tools.logs.LogType.Slf4j) class TestClass6(val i: Int = 0, var j: Int)""" should compile
"""@log(verbose=true, logType=org.bitlap.tools.logs.LogType.Slf4j) class TestClass6(val i: Int = 0, var j: Int){ log.info("hello world") }""" should compile
"""@log(logType = org.bitlap.tools.logs.LogType.Slf4j) @builder class TestClass6(val i: Int = 0, var j: Int){ log.info("hello world") }
| @log(logType = org.bitlap.tools.logs.LogType.Slf4j) object TestClass6 { log.info("hello world");builder() }""".stripMargin should compile //default verbose is false
@log(logType = io.github.dreamylost.logs.LogType.Slf4j)
@log(logType = org.bitlap.tools.logs.LogType.Slf4j)
@builder class TestClass8(val i: Int = 0, var j: Int) {
log.info("hello world")
}
......@@ -130,8 +130,8 @@ class LogTest extends AnyFlatSpec with Matchers {
"log9 slf4j" should "ok on class and it object" in {
"""
|@log(logType = io.github.dreamylost.logs.LogType.Slf4j) @builder class TestClass6(val i: Int = 0, var j: Int){ log.info("hello world") }
|@log(logType = io.github.dreamylost.logs.LogType.Slf4j) object TestClass6 { log.info("hello world"); builder()}
|@log(logType = org.bitlap.tools.logs.LogType.Slf4j) @builder class TestClass6(val i: Int = 0, var j: Int){ log.info("hello world") }
|@log(logType = org.bitlap.tools.logs.LogType.Slf4j) object TestClass6 { log.info("hello world"); builder()}
|""".stripMargin should compile
}
......@@ -141,7 +141,7 @@ class LogTest extends AnyFlatSpec with Matchers {
| @builder case class TestClass6_2(val i: Int = 0, var j: Int) {
| log.info("hello world")
| }
| @log(logType = io.github.dreamylost.logs.LogType.Slf4j) object TestClass6_2 {
| @log(logType = org.bitlap.tools.logs.LogType.Slf4j) object TestClass6_2 {
| log.info("hello world"); builder()
| }
|""".stripMargin shouldNot compile
......@@ -149,22 +149,22 @@ class LogTest extends AnyFlatSpec with Matchers {
"log11 slf4j" should "ok on class and it object" in {
"""
| @log(logType = io.github.dreamylost.logs.LogType.Slf4j)
| @log(logType = org.bitlap.tools.logs.LogType.Slf4j)
| @builder class TestClass6(val i: Int = 0, var j: Int) {
| log.info("hello world")
| }
|@log(logType = io.github.dreamylost.logs.LogType.Slf4j) object TestClass6 {
|@log(logType = org.bitlap.tools.logs.LogType.Slf4j) object TestClass6 {
| log.info("hello world"); builder()
| }
|""".stripMargin should compile
"""
| @builder
| @log(logType = io.github.dreamylost.logs.LogType.Slf4j)
| @log(logType = org.bitlap.tools.logs.LogType.Slf4j)
| class TestClass6(val i: Int = 0, var j: Int) {
| log.info("hello world")
| }
|@log(logType = io.github.dreamylost.logs.LogType.Slf4j) object TestClass6 {
|@log(logType = org.bitlap.tools.logs.LogType.Slf4j) object TestClass6 {
| log.info("hello world"); builder()
| }
|""".stripMargin should compile
......@@ -177,10 +177,10 @@ class LogTest extends AnyFlatSpec with Matchers {
@log object TestLog1 {
log.info("")
}
@log(logType = io.github.dreamylost.logs.LogType.Slf4j) class TestLog2() {
@log(logType = org.bitlap.tools.logs.LogType.Slf4j) class TestLog2() {
log.info("")
}
import io.github.dreamylost.logs.LogType.JLog
import org.bitlap.tools.logs.LogType.JLog
@log(logType = JLog) class TestLog3() {
log.info("")
}
......@@ -190,7 +190,7 @@ class LogTest extends AnyFlatSpec with Matchers {
}
"log12 slf4j" should "failed when input not in order" in {
"""
| import io.github.dreamylost.logs.LogType
| import org.bitlap.tools.logs.LogType
| @log(logType = LogType.Slf4j, verbose = true)
| @builder class TestClass6(val i: Int = 0, var j: Int) {
| log.info("hello world")
......@@ -200,20 +200,20 @@ class LogTest extends AnyFlatSpec with Matchers {
"log13 scala loggging lazy" should "ok when does not exists super class" in {
"""
| import io.github.dreamylost.logs.LogType
| import org.bitlap.tools.logs.LogType
| @log(logType = LogType.ScalaLoggingLazy)
| class TestClass1(val i: Int = 0, var j: Int) {
| log.info("hello world")
| }
|""".stripMargin should compile
import io.github.dreamylost.logs.LogType
import org.bitlap.tools.logs.LogType
@log(logType = LogType.ScalaLoggingLazy)
class TestClass2(val i: Int = 0, var j: Int) {
log.info("hello world")
}
"""
| import io.github.dreamylost.logs.LogType
| import org.bitlap.tools.logs.LogType
| @log(logType = LogType.ScalaLoggingLazy)
| class TestClass3(val i: Int = 0, var j: Int) {
| log.info("hello world")
......@@ -221,7 +221,7 @@ class LogTest extends AnyFlatSpec with Matchers {
|""".stripMargin should compile
"""
| import io.github.dreamylost.logs.LogType
| import org.bitlap.tools.logs.LogType
| @log(logType = LogType.ScalaLoggingLazy)
| object TestClass4 {
| log.info("hello world")
......@@ -231,20 +231,20 @@ class LogTest extends AnyFlatSpec with Matchers {
"log14 scala loggging strict" should "ok when exists super class" in {
"""
| import io.github.dreamylost.logs.LogType
| import org.bitlap.tools.logs.LogType
| @log(logType = LogType.ScalaLoggingStrict)
| class TestClass1(val i: Int = 0, var j: Int) extends Serializable {
| log.info("hello world")
| }
|""".stripMargin should compile
import io.github.dreamylost.logs.LogType
import org.bitlap.tools.logs.LogType
@log(logType = LogType.ScalaLoggingStrict)
class TestClass2(val i: Int = 0, var j: Int) extends Serializable {
log.info("hello world")
}
"""
| import io.github.dreamylost.logs.LogType
| import org.bitlap.tools.logs.LogType
| @log(logType = LogType.ScalaLoggingStrict)
| class TestClass3(val i: Int = 0, var j: Int) extends Serializable {
| log.info("hello world")
......@@ -252,7 +252,7 @@ class LogTest extends AnyFlatSpec with Matchers {
|""".stripMargin should compile
"""
| import io.github.dreamylost.logs.LogType
| import org.bitlap.tools.logs.LogType
| @log(logType = LogType.ScalaLoggingStrict)
| object TestClass4 extends Serializable {
| log.info("hello world")
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
/**
*
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
......@@ -32,7 +32,7 @@ import org.scalatest.matchers.should.Matchers
*/
class OthersTest extends AnyFlatSpec with Matchers {
"others" should "ok" in {
assert(PACKAGE == "io.github.dreamylost")
assert(PACKAGE == "org.bitlap.tools")
"""
| @builder
......@@ -40,7 +40,7 @@ class OthersTest extends AnyFlatSpec with Matchers {
|""".stripMargin shouldNot compile
"""
| class Test extends _root_.io.github.dreamylost.logs.extension.ScalaStrictLogging {
| class Test extends _root_.org.bitlap.tools.logs.extension.ScalaStrictLogging {
| log.info("hello")
| }
|""".stripMargin should compile
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,10 +19,10 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import com.alipay.sofa.jraft.rpc.{ RpcContext, RpcRequestClosure, RpcRequestProcessor }
import io.github.dreamylost.test.proto.BOpenSession.{ BOpenSessionReq, BOpenSessionResp }
import org.bitlap.tools.test.proto.BOpenSession.{ BOpenSessionReq, BOpenSessionResp }
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
......
/*
* Copyright (c) 2021 jxnu-liguobin && contributors
* Copyright (c) 2021 org.bitlap
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.dreamylost
package org.bitlap.tools
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
......@@ -285,12 +285,12 @@ class ToStringTest extends AnyFlatSpec with Matchers {
val s5 = new TestClass5().toString
println(s5)
// Because not support if super class is a trait
assert(s5.startsWith("TestClass5(super=io.github.dreamylost.ToStringTes") && s5.endsWith("1)"))
assert(s5.startsWith("TestClass5(super=org.bitlap.tools.ToStringTes") && s5.endsWith("1)"))
}
"toString17" should "failed when input not in order" in {
"""
| import io.github.dreamylost.logs.LogType
| import org.bitlap.tools.logs.LogType
| @toString(includeFieldNames = false, callSuper = true, verbose = true)
| class TestClass6(val i: Int = 0, var j: Int)
|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册