Skip to content

Commit

Permalink
Merge branch 'main' into stb
Browse files Browse the repository at this point in the history
  • Loading branch information
squid233 committed Aug 23, 2023
2 parents 8ac0c4c + 0020316 commit cf6b687
Show file tree
Hide file tree
Showing 39 changed files with 496 additions and 369 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ subprojects {

tasks.register("assembleJavadocArgs") {
group = "build"
val mspFile = Path("${rootProject.buildDir}/tmp/modulesourcepath.args")
val mspFile = Path("${rootProject.layout.buildDirectory.get().asFile}/tmp/modulesourcepath.args")
outputs.file(mspFile)

doLast {
Expand All @@ -222,13 +222,13 @@ tasks.register<Javadoc>("aggregateJavadoc") {
val projectsToDoc = Artifact.values().map { project(it.subprojectName) }
dependsOn(projectsToDoc.map { it.getTasksByName("classes", true) })
source(projectsToDoc.map { it.sourceSets["main"].java })
destinationDir = File("$buildDir/docs/javadoc")
destinationDir = File("${layout.buildDirectory.get().asFile}/docs/javadoc")

classpath = files(projectsToDoc.map { it.configurations["compileClasspath"].files })

executable = project.findProperty("javadocExecutable") as String?

options.optionFiles = listOf(File("${rootProject.buildDir}/tmp/modulesourcepath.args"))
options.optionFiles = listOf(File("${rootProject.layout.buildDirectory.get().asFile}/tmp/modulesourcepath.args"))
}

allprojects {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package overrungl;

import overrungl.internal.RuntimeHelper;
import overrungl.util.MemoryUtil;

import java.lang.foreign.FunctionDescriptor;
import java.lang.foreign.ValueLayout;
Expand Down Expand Up @@ -122,7 +122,7 @@ public static ValueLayout ofValue(char c) throws IllegalArgumentException {
case 'F' -> JAVA_FLOAT;
case 'D' -> JAVA_DOUBLE;
case 'P' -> ADDRESS;
case 'p' -> RuntimeHelper.ADDRESS_UNBOUNDED;
case 'p' -> MemoryUtil.ADDRESS_UNBOUNDED;
default ->
throw new IllegalArgumentException(
STR."Invalid argument c: expected one of B, S, I, J, C, Z, F, D, P or p; got '\{c}'"
Expand Down
39 changes: 0 additions & 39 deletions modules/overrungl.core/src/main/java/overrungl/util/CheckUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,43 +107,4 @@ public static void checkNotNullptr(MemorySegment segment, Supplier<String> messa
public static void checkNotNullptr(MemorySegment segment, String message) throws IllegalStateException {
if (MemoryUtil.isNullptr(segment)) throw new IllegalStateException(message);
}

/**
* Checks whether the given object is not {@code null}.
*
* @param o the object.
* @throws IllegalStateException if <i>{@code object}</i> is {@code null}.
* @see #checkNotNull(Object, Supplier)
* @see #checkNotNull(Object, String)
*/
public static void checkNotNull(Object o) throws IllegalStateException {
checkNotNull(o, "condition == false");
}

/**
* Checks whether the given object is not {@code null}. The message of the exception is wrapped in a supplier
* to avoid side effect.
*
* @param o the object.
* @param messageSupplier the message supplier of the exception.
* @throws IllegalStateException if <i>{@code object}</i> is {@code null}.
* @see #checkNotNull(Object)
* @see #checkNotNull(Object, String)
*/
public static void checkNotNull(Object o, Supplier<String> messageSupplier) throws IllegalStateException {
if (o == null) throw new IllegalStateException(messageSupplier.get());
}

/**
* Checks whether the given object is not {@code null}.
*
* @param o the object.
* @param message the message of the exception.
* @throws IllegalStateException if <i>{@code object}</i> is {@code null}.
* @see #checkNotNull(Object)
* @see #checkNotNull(Object, Supplier)
*/
public static void checkNotNull(Object o, String message) throws IllegalStateException {
if (o == null) throw new IllegalStateException(message);
}
}
Loading

0 comments on commit cf6b687

Please sign in to comment.