Skip to content

Commit

Permalink
Merge pull request #31 from modelix/trackable-map-removeIf
Browse files Browse the repository at this point in the history
TrackableMap.removeWhere
  • Loading branch information
slisson authored May 23, 2024
2 parents 9e9cf44 + 08ecea1 commit 0623294
Show file tree
Hide file tree
Showing 56 changed files with 2,214 additions and 126 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/build
/*/build
.gradle
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

157 changes: 33 additions & 124 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,110 +1,9 @@
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotlin.allopen)
alias(libs.plugins.kotlin.benchmark)
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.gitVersion)
`maven-publish`
}

repositories {
mavenCentral()
}

kotlin {
/* Targets configuration omitted.
* To find out how to configure the targets, please follow the link:
* https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#setting-up-targets */

jvm {
jvmToolchain(11)
}
js(IR) {
browser {}
nodejs {
testTask {
useMocha {
timeout = "10s"
}
}
}
}

sourceSets {
val commonMain by getting {
dependencies {
implementation(kotlin("stdlib-common"))
implementation(libs.kotlin.logging)
implementation(libs.kotlin.coroutines.core)
implementation(libs.kotlin.benchmark.runtime)
}
}
val commonTest by getting {
dependencies {
implementation(libs.kotlin.coroutines.test)
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
val jvmMain by getting {
dependencies {
implementation(libs.kotlin.coroutines.swing)
}
}
val jvmTest by getting {
dependencies {
implementation(kotlin("test"))
implementation(kotlin("test-junit"))
}
}
val jsMain by getting {
dependencies {
}
}
val jsTest by getting {
dependencies {
implementation(kotlin("test-js"))
}
}
}
}

allOpen {
annotation("org.openjdk.jmh.annotations.State")
}

benchmark {
targets {
register("jvmTest")
register("jsTest")
}
configurations {
named("main") {
warmups = 4
iterations = 10
iterationTime = 1
iterationTimeUnit = "s"
outputTimeUnit = "s"
// mode = "avgt"
reportFormat = "text"
include(".*")
}
create("sum") {
warmups = 4
iterations = 10
iterationTime = 1
iterationTimeUnit = "s"
outputTimeUnit = "s"
reportFormat = "text"
include("RecursiveSum")
exclude("RecursiveSumLarge")
exclude("RecursiveSumNonIncremental")
}
}
}

group = "org.modelix"
description = "Incremental computation engine"

val versionFile = projectDir.resolve("version.txt")
version = if (versionFile.exists()) {
versionFile.readText().trim()
Expand All @@ -115,33 +14,43 @@ version = if (versionFile.exists()) {
}
println("Version: $version")

publishing {
allprojects {
apply(plugin = "maven-publish")
repositories {
if (project.hasProperty("artifacts.itemis.cloud.user")) {
maven {
name = "itemisNexus3"
url = if (version.toString().contains("SNAPSHOT")) {
uri("https://artifacts.itemis.cloud/repository/maven-mps-snapshots/")
} else {
uri("https://artifacts.itemis.cloud/repository/maven-mps-releases/")
}
credentials {
username = project.findProperty("artifacts.itemis.cloud.user").toString()
password = project.findProperty("artifacts.itemis.cloud.pw").toString()
mavenCentral()
}

group = "org.modelix"
version = rootProject.version

publishing {
repositories {
if (project.hasProperty("artifacts.itemis.cloud.user")) {
maven {
name = "itemisNexus3"
url = if (version.toString().contains("SNAPSHOT")) {
uri("https://artifacts.itemis.cloud/repository/maven-mps-snapshots/")
} else {
uri("https://artifacts.itemis.cloud/repository/maven-mps-releases/")
}
credentials {
username = project.findProperty("artifacts.itemis.cloud.user").toString()
password = project.findProperty("artifacts.itemis.cloud.pw").toString()
}
}
}
}

val ghp_username = project.findProperty("gpr.user") as? String ?: System.getenv("GITHUB_ACTOR")
val ghp_password = project.findProperty("gpr.key") as? String ?: System.getenv("GITHUB_TOKEN")
val ghp_username = project.findProperty("gpr.user") as? String ?: System.getenv("GITHUB_ACTOR")
val ghp_password = project.findProperty("gpr.key") as? String ?: System.getenv("GITHUB_TOKEN")

if (ghp_username != null && ghp_password != null) {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/modelix/incremental")
credentials {
username = ghp_username
password = ghp_password
if (ghp_username != null && ghp_password != null) {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/modelix/incremental")
credentials {
username = ghp_username
password = ghp_password
}
}
}
}
Expand Down
51 changes: 51 additions & 0 deletions dependency-tracking/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
plugins {
alias(libs.plugins.kotlin.multiplatform)
}

repositories {
mavenCentral()
}

kotlin {
jvm {
jvmToolchain(11)
}
js(IR) {
browser {}
nodejs {
testTask {
useMocha {
timeout = "10s"
}
}
}
}

sourceSets {
val commonMain by getting {
dependencies {
implementation(libs.kotlin.logging)
}
}
val commonTest by getting {
dependencies {
}
}
val jvmMain by getting {
dependencies {
}
}
val jvmTest by getting {
dependencies {
}
}
val jsMain by getting {
dependencies {
}
}
val jsTest by getting {
dependencies {
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ interface IStateVariableGroup {
* Groups form a tree of dependencies that are more detailed towards the leafs.
* To save memory the engine can decrease the granularity of recorded dependencies and just record one of the groups
* instead of the dependency itself. This may trigger a re-computation more often, but the goal is to reduce the
* granularity only for those inputs that don't change often. It's a space-time trade off.
* granularity only for those inputs that don't change often. It's a space vs. time trade off.
*
* Example: In case of a dependency on a node in the model the groups would the ancestors of that node.
* Example: In case of a dependency on a node in the model the groups would be the ancestors of that node.
*
* A change of the group has to be notified.
*/
Expand Down
Loading

0 comments on commit 0623294

Please sign in to comment.