Skip to content

Commit

Permalink
Merge pull request #1569 from NASA-AMMOS/feat/generate-default-method…
Browse files Browse the repository at this point in the history
…s-on-jvm

Generate JVM default methods for procedural interfaces
  • Loading branch information
JoelCourtney authored Oct 10, 2024
2 parents aff0fba + 7526fe0 commit 86108a9
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 15 deletions.
3 changes: 3 additions & 0 deletions procedural/constraints/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ tasks.named('test') {

kotlin {
jvmToolchain(21)
compilerOptions {
freeCompilerArgs.add("-Xjvm-default=all")
}
}

java {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package gov.nasa.ammos.aerie.procedural.constraints;

import gov.nasa.ammos.aerie.procedural.timeline.Interval;
import gov.nasa.ammos.aerie.procedural.timeline.collections.Directives;
import gov.nasa.ammos.aerie.procedural.timeline.plan.Plan;
import gov.nasa.jpl.aerie.merlin.protocol.types.Duration;
import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue;
import kotlin.NotImplementedError;
import kotlin.jvm.functions.Function1;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.time.Instant;

public class NotImplementedPlan implements Plan {
@NotNull
@Override
public Interval totalBounds() {
throw new NotImplementedError();
}

@NotNull
@Override
public Duration toRelative(@NotNull final Instant abs) {
throw new NotImplementedError();
}

@NotNull
@Override
public Instant toAbsolute(@NotNull final Duration rel) {
throw new NotImplementedError();
}

@NotNull
@Override
public <A> Directives<A> directives(
@Nullable final String type,
@NotNull final Function1<? super SerializedValue, ? extends A> deserializer)
{
throw new NotImplementedError();
}
}

This file was deleted.

3 changes: 3 additions & 0 deletions procedural/scheduling/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ tasks.named('test') {

kotlin {
jvmToolchain(21)
compilerOptions {
freeCompilerArgs.add("-Xjvm-default=all")
}
}

java {
Expand Down
3 changes: 3 additions & 0 deletions procedural/timeline/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ tasks.named('test') {

kotlin {
jvmToolchain(21)
compilerOptions {
freeCompilerArgs.add("-Xjvm-default=all")
}
}

java {
Expand Down

0 comments on commit 86108a9

Please sign in to comment.