Skip to content

Commit

Permalink
Merge pull request #1 from doip-sim-ecu/feature/replace_doip_lib
Browse files Browse the repository at this point in the history
Replace doip-project library with own implementation
  • Loading branch information
froks committed Feb 8, 2022
2 parents ddb5cc3 + 0494d98 commit 8db66c4
Show file tree
Hide file tree
Showing 32 changed files with 1,556 additions and 270 deletions.
51 changes: 40 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,25 +1,54 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

group = "com.github.doip-sim-ecu"
version = "0.2.5"

plugins {
kotlin("jvm")
kotlin("plugin.allopen")
`maven-publish`
`java-library`
}

group = "com.github.doip-sim-ecu"
version = "0.5.0"

repositories {
mavenCentral()
}

val ktorVersion = "1.6.7"

dependencies {
implementation(kotlin("stdlib-jdk8"))
api("io.ktor:ktor-network:$ktorVersion")
// implementation("io.ktor:ktor-network-sockets:$ktorVersion")
// implementation("io.ktor:ktor-network-tls:$ktorVersion")
// implementation("io.ktor:ktor-network-tls-certificates:$ktorVersion")
api("ch.qos.logback:logback-classic:1.2.10")

testImplementation(kotlin("test"))
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
testImplementation("org.mockito.kotlin:mockito-kotlin:4.0.0")
testImplementation("com.willowtreeapps.assertk:assertk-jvm:0.25")
}

val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
jvmTarget = "1.8"
tasks.test {
useJUnitPlatform()
}
val compileTestKotlin: KotlinCompile by tasks
compileTestKotlin.kotlinOptions {
jvmTarget = "1.8"

java {
withSourcesJar()
}

publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
}
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}

allOpen {
annotation("helper.Open")
}

51 changes: 0 additions & 51 deletions doip-sim-ecu-dsl/build.gradle.kts

This file was deleted.

13 changes: 0 additions & 13 deletions doip-sim-ecu-dsl/src/main/kotlin/helper/LoggerExtensions.kt

This file was deleted.

42 changes: 0 additions & 42 deletions doip-sim-ecu-dsl/src/test/resources/log4j2.xml

This file was deleted.

3 changes: 1 addition & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ pluginManagement {
val kotlinVersion: String by settings
plugins {
kotlin("jvm").version(kotlinVersion).apply(false)
id("com.github.johnrengelman.shadow") version "7.1.0" apply false
kotlin("plugin.allopen").version(kotlinVersion).apply(false)
}
}

rootProject.name = "doip-sim-ecu-dsl"

include("doip-sim-ecu-dsl")
//include("doip-sim-ecu-dsl-test")
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import doip.library.message.UdsMessage
import helper.decodeHex
import helper.toHexString
import library.UdsMessage
import library.decodeHex
import library.toHexString
import java.util.*
import kotlin.IllegalArgumentException
import kotlin.time.Duration
Expand Down Expand Up @@ -55,10 +55,11 @@ object NrcError {

open class RequestMessage(udsMessage: UdsMessage, val isBusy: Boolean) :
UdsMessage(
udsMessage.sourceAdrress,
udsMessage.sourceAddress,
udsMessage.targetAddress,
udsMessage.targetAddressType,
udsMessage.message)
udsMessage.message,
udsMessage.output)

/**
* Define the response to be sent after the function returns
Expand Down Expand Up @@ -337,8 +338,8 @@ open class RequestsData(
*/
open class EcuData(
name: String,
var physicalAddress: Int = 0,
var functionalAddress: Int = 0,
var physicalAddress: Short = 0,
var functionalAddress: Short = 0,
nrcOnNoMatch: Boolean = true,
requests: List<RequestMatcher> = emptyList(),
resetHandler: List<ResetHandler> = emptyList(),
Expand Down Expand Up @@ -370,7 +371,7 @@ fun reset() {
}

fun stop() {
gatewayInstances.forEach { it.stop() }
// gatewayInstances.forEach { it.stop() }
gatewayInstances.clear()
}

Expand Down
Loading

0 comments on commit 8db66c4

Please sign in to comment.