mike_shysh
01/16/2019, 1:38 PMgradle clean test
SrSouza
01/16/2019, 2:44 PMLeoColman
01/16/2019, 3:46 PMGlobalScope.launch {
val deferred = GlobalScope.async {
while (true) {
}
}
val result = withTimeout(100) {
deferred.await()
}
println(result)
}
Jonny
05/30/2020, 10:17 PMGalou Minisini
05/31/2020, 2:20 AMmplain
05/31/2020, 10:44 AMmplain
05/31/2020, 10:44 AMmplain
05/31/2020, 10:45 AMmplain
05/31/2020, 10:46 AMif (n != null) { n = null } else throw Exception
mplain
05/31/2020, 10:47 AMn.takeIf { it != null }?.let { it = null } ?: throw Exception
mplain
05/31/2020, 10:49 AMmplain
05/31/2020, 10:49 AMmplain
05/31/2020, 10:53 AMWilliam
06/01/2020, 9:23 AMWilliam
06/01/2020, 12:58 PMActivity.*
For example: for this structure
my_project
-> feature1
-> src
-> java
-> com
-> directory
-> MainActivity.kt
-> MainFragment.kt
-> feature2
-> src
-> java
-> com
-> directory
-> Feature2Activity.kt
-> Feature2Fragment.kt
Should generate
{
"my_project": {
"feature1": {
"directory": [
"MainActivity"
]
},
"feature2": {
"directory": [
"Feature2Activity"
]
}
}
}
I don't have decencies to any Android modules, just Kotlin maybe using FileTreeWalkMgkaki
06/02/2020, 6:03 AMdependencies {
val swaggerVersion = "2.9.2"
val hikaricpVersion = "3.3.1"
val typesafeVersion = "1.4.0"
val kotlinloggingVersion = "1.7.9"
val modelMapperVersion = "2.3.7"
subprojects.forEach {
if( it.name != "common" ) {
implementation(project(it.path)) {
dependencies {
implementation(project(":common"))
}
}
} else {
implementation(project(":common"))
}
}
implementation("com.zaxxer:HikariCP:${hikaricpVersion}")
implementation("org.springframework.boot:spring-boot-starter-web")
::::
}
I trid this but it(internal) don't import common modules as a dependency.
settings.gradle.kts
rootProject.name = "gia"
include("common", "internal")
zkeme
06/03/2020, 5:53 PMDariusz Kuc
06/04/2020, 2:43 AM@Plugin(name = "StandardLogLayout", category = Node.CATEGORY, elementType = Layout.ELEMENT_TYPE)
class StandardLogLayout(config: Configuration?, aCharset: Charset?, headerSerializer: Serializer? = null, footerSerializer: Serializer? = null) : AbstractStringLayout(config, aCharset, headerSerializer, footerSerializer) {
companion object {
@PluginFactory
@JvmStatic
fun createLayout(
@PluginConfiguration config: Configuration?,
@PluginAttribute(value = "charset", defaultString = "UTF-8") charset: Charset?
): StandardLogLayout = StandardLogLayout(config, charset)
// actual logging logic that auto formats the message
}
and then in my log4j2.xml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="DEBUG">
<Appenders>
<Console name="standardLayout" target="SYSTEM_OUT" follow="true">
<StandardLogLayout/>
</Console>
</Appenders>
<Loggers>
<Root level="INFO">
<AppenderRef ref="standardLayout"/>
</Root>
</Loggers>
</Configuration>
but unfortunately it doesn’t work. Tried configuring kapt
with log4j2-core
as annotation processor but it didn’t work either…. Any help would be appreciateduser
06/04/2020, 10:43 AMuser
06/04/2020, 11:53 AMrrva
06/04/2020, 6:00 PMrrva
06/04/2020, 6:04 PMNico
06/05/2020, 6:19 AMmplain
06/06/2020, 10:29 AMRyan
06/06/2020, 12:23 PMmplain
06/06/2020, 1:47 PMRyan
06/06/2020, 2:00 PMQuy D X Nguyen
06/06/2020, 7:18 PMException in thread "main" java.lang.NoSuchFieldError: burstLimiter
at mdnet.base.Netty$toServer$1$start$$inlined$apply$lambda$1.<init>(Netty.kt:91)
at mdnet.base.Netty$toServer$1.start(Netty.kt:89)
at mdnet.base.Client.runLoop(MangadexClient.java:59)
at mdnet.base.Client.main(MangadexClient.java:190)
Code (without the anonymous object for BurstLimiter) it works fine:
.childHandler(object : ChannelInitializer<SocketChannel>() {
private val counter = ConnectionCounter()
private val burstLimiter = object: GlobalTrafficShapingHandler(
workerGroup, 1024 * clientSettings.maxBurstRateKibPerSecond, 0, 50) {
override fun doAccounting(counter: TrafficCounter) {
stats.get().bytesSent.getAndAdd(counter.cumulativeWrittenBytes())
}
}
public override fun initChannel(ch: SocketChannel) {
ch.pipeline().addLast("ssl", OptionalSslHandler(sslContext))
ch.pipeline().addLast("codec", HttpServerCodec())
ch.pipeline().addLast("counter", counter)
ch.pipeline().addLast("aggregator", HttpObjectAggregator(65536))
ch.pipeline().addLast("burstLimiter", this.burstLimiter)
ch.pipeline().addLast("streamer", ChunkedWriteHandler())
ch.pipeline().addLast("handler", Http4kChannelHandler(httpHandler))
}
})