Skip to content

Commit

Permalink
proj: move source roots
Browse files Browse the repository at this point in the history
  • Loading branch information
ice1000 committed Dec 13, 2023
1 parent 1ce17eb commit acc3ad9
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 17 deletions.
7 changes: 5 additions & 2 deletions base/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// Copyright (c) 2020-2023 Tesla (Yinsen) Zhang.
// Use of this source code is governed by the MIT license that can be found in the LICENSE.md file.
import org.aya.gradle.*
import org.aya.gradle.CommonTasks
import org.aya.gradle.GenerateReflectionConfigTask
import org.aya.gradle.GenerateVersionTask

CommonTasks.nativeImageConfig(project)

dependencies {
api(project(":tools"))
api(project(":tools-kala"))
api(project(":tools-md"))
api(project(":pretty"))
api(libs.aya.guest0x0)
Expand Down
6 changes: 6 additions & 0 deletions tools-kala/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright (c) 2020-2023 Tesla (Yinsen) Zhang.
// Use of this source code is governed by the MIT license that can be found in the LICENSE.md file.
dependencies {
api(libs.kala.common)
api(project(":tools"))
}
9 changes: 9 additions & 0 deletions tools-kala/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module aya.util.kala {
requires transitive aya.util;

requires static org.jetbrains.annotations;
requires transitive kala.collection.primitive;

exports org.aya.util.tyck.pat;
exports org.aya.util.terck;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2022 Tesla (Yinsen) Zhang.
// Copyright (c) 2020-2023 Tesla (Yinsen) Zhang.
// Use of this source code is governed by the MIT license that can be found in the LICENSE.md file.
package org.aya.util.terck;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2022 Tesla (Yinsen) Zhang.
// Copyright (c) 2020-2023 Tesla (Yinsen) Zhang.
// Use of this source code is governed by the MIT license that can be found in the LICENSE.md file.
package org.aya.util.terck;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
// Copyright (c) 2020-2022 Tesla (Yinsen) Zhang.
// Copyright (c) 2020-2023 Tesla (Yinsen) Zhang.
// Use of this source code is governed by the MIT license that can be found in the LICENSE.md file.
package org.aya.util.terck;

import kala.collection.immutable.ImmutableSeq;
import kala.collection.mutable.MutableList;
import kala.range.primitive.IntRange;
import org.aya.pretty.doc.Doc;
import org.aya.pretty.doc.Docile;
import org.jetbrains.annotations.NotNull;

import java.util.stream.IntStream;

public record Diagonal<C, T, P>(
@NotNull CallMatrix<C, T, P> matrix,
@NotNull ImmutableSeq<Relation> diagonal
) implements Docile {
public static <C, T, P> @NotNull Diagonal<C, T, P> create(@NotNull CallMatrix<C, T, P> matrix) {
assert matrix.rows() == matrix.cols();
var diag = IntStream.range(0, matrix.rows())
.mapToObj(i -> matrix.matrix()[i][i])
.collect(ImmutableSeq.factory());
var diag = IntRange.openClosed(0, matrix.rows())
.mapToObjTo(MutableList.create(), i -> matrix.matrix()[i][i])
.toImmutableSeq();
return new Diagonal<>(matrix, diag);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2022 Tesla (Yinsen) Zhang.
// Copyright (c) 2020-2023 Tesla (Yinsen) Zhang.
// Use of this source code is governed by the MIT license that can be found in the LICENSE.md file.
package org.aya.util.terck;

Expand Down
5 changes: 2 additions & 3 deletions tools-repl/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Copyright (c) 2020-2022 Tesla (Yinsen) Zhang.
// Copyright (c) 2020-2023 Tesla (Yinsen) Zhang.
// Use of this source code is governed by the MIT license that can be found in the LICENSE.md file.
dependencies {
api(project(":pretty"))
api(project(":tools"))
api(project(":tools-kala"))
api(libs.jline.reader)
api(libs.jline.terminal.api)
}
2 changes: 1 addition & 1 deletion tools/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by the MIT license that can be found in the LICENSE.md file.
dependencies {
api(libs.annotations)
api(libs.kala.common)
api(libs.kala.collection)
api(project(":pretty"))
implementation(libs.aya.ij.text)
testImplementation(libs.junit.jupiter)
Expand Down
2 changes: 0 additions & 2 deletions tools/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
exports org.aya.util.error;
exports org.aya.util.prettier;
exports org.aya.util.reporter;
exports org.aya.util.terck;
exports org.aya.util.tyck.pat;
exports org.aya.util.tyck;
exports org.aya.util;
}

0 comments on commit acc3ad9

Please sign in to comment.