Skip to content

Releases: SpineEventEngine/base

1.9.0

20 May 13:11
4e5dc1e
Compare
Choose a tag to compare

This is a part of Spine release in version 1.9.0.

Several significant changes have been made in this release to base modules.

  • Environment-related types were moved under io.spine.environment package;

  • Production was renamed to DefaultMode;

  • It is now possible to check whether the environment is enabled; see EnvironmentType.enabled();

  • It is also possible to configure a callback executed upon the environment type detection; see EnvironmentType.onDetected(...);

  • The API for the custom environment types was changed; see io.spine.environment.CustomEnvironmentType and its documentation for more detail.

  • In the Preconditions2 helper class the following methods are now annotated with @CanIgnoreReturnValue:

    • checkNotEmptyOrBlank(String str, @Nullable Object errorMessage)
    • checkNotEmptyOrBlank(String str, @Nullable String errorMessageTemplate, @Nullable Object @Nullable ... errorMessageArgs)
    • checkPositive(long value)
    • checkPositive(long value, @Nullable String errorMessageTemplate, @Nullable Object @Nullable ... errorMessageArgs)
  • Previously used jCenter() references were replaced with mavenCentral(), as JCenter no longer provides a public Maven repository.

See the following PRs for more detail:

1.8.2

29 Jun 11:30
38acb71
Compare
Choose a tag to compare

This is a part of Spine release in version 1.8.2.

Several of Spine libraries were improved after analysing the real-world use cases.

In base modules, there is no notable changes comparing to the previous public release.

1.8.0

15 Dec 16:55
457bf41
Compare
Choose a tag to compare

This is a release of Spine base modules, which supports the new features in the upcoming 1.8.0 release of Spine's core-java modules.

1.7.4

13 Sep 09:43
bcfc0a2
Compare
Choose a tag to compare

This is a patch release of Spine 1.x. It follows up on the production use of Spine libraries and brings a few requested improvements.

  • Fixed pub cache for Windows OS. (see #605).
  • Improved internal packaging structure (see #608).

Additionally, several improvements of config scripts were brought to this version.

Compare v1.7.0 and v1.7.4.

1.7.0

14 Dec 10:35
f6d12cc
Compare
Choose a tag to compare

This release brings internal API improvements, better support for the tooling and Dart as well as improvements to the Environment and tests APIs.

Breaking Changes

  1. Removed deprecated APIs in the UtilityClassTest class.

    Please use subject() over removed getUtilityClass().

  2. Removed deprecated methods in the Validate utility.

    Please consider migrating to mirrored methods in Preconditions2 and check out the related PR #596.

  3. Removed deprecated methods in the Environment utility and introduced a new CustomEnvironmentType abstraction for custom environments.

    Consider changing your custom environments parent class from EnvironmentType to CustomEnvironmentType. And when registering new environments please use Environment.register(Class<? extends CustomEnvironmentType>) or the previously accessible method with an environment instance argument.

    Please use Environment.instance().is(Tests.class) over the previously deprecated and now removed Environment.isTests().

    Please use Environment.instance().is(Production.class) over the previously deprecated and now removed Environment.isProduction().

    To set a custom environment please use the Environment.setTo(Class<? extends EnvironmentType>) over the previously available method with an environment instance argument. Also, use the same method over the previously deprecated and now removed Environment.setToTests() and Environment.setToProduction().

    Consult PR #594 for extra details on the improvements and removals of the deprecated APIs.

  4. MethodFactory and NestedClassFactory interfaces are extracted into a separate spine-tools-api artifact.

    In case you were implementing a custom MethodFactory or NestedClassFactory, please consider adding the spine-tools-api dependency to the respective module.

    You can use the following snippet to add the dependency to your Gradle project:

    dependencies {
        implementation("io.spine.tools:spine-tools-api:1.7.0")
    }

API changes

On top of the breaking changes here are some minor API changes introduced in the release.

  1. Resource.file(String) is deprecated in favor of Resource.file(String, ClassLoader).

    It is always recommended to provide a particular ClassLoader instance to achieve predictable and reproducible access to resources while using the Resource utility. Please consult PR #566 for more details on the matter.

  2. The new SingletonClassTest test abstraction to simplify testing singletons. (see PR #583 for details).

  3. Improved test assertions support with the new Assertions and TempDir utilities available in the testlib project.

    The Assertions utility provides convenient assertions to verify that one of the exceptions was thrown by introducing the following methods:

    /**
     * Asserts that running the passed executable causes {@link IllegalArgumentException}.
     */
    @CanIgnoreReturnValue
    public static IllegalArgumentException assertIllegalArgument(Executable e)
    
    /**
     * Asserts that running the passed executable causes {@link IllegalStateException}.
     */
    @CanIgnoreReturnValue
    public static IllegalStateException assertIllegalState(Executable e)
    
    /**
     * Asserts that running the passed executable causes {@link UnknownTypeException}.
     */
    @CanIgnoreReturnValue
    public static UnknownTypeException assertUnknownType(Executable e)
    
    /**
     * Asserts that running the passed executable cases {@link NullPointerException}.
     */
    @CanIgnoreReturnValue
    public static NullPointerException assertNpe(Executable e)

    The TempDir provides a replacement for the deprecated com.google.common.io.Files#createTempDir().

    Please consult PR #585 for additional details.

  4. The TypeUrl prefix is the Protobuf file declaration may now be empty.

    One may now specify an empty (type_url_prefix) option in the Protobuf if she does not intend to use
    the type URLs.

    The following declaration is now fully legit:

    syntax = "proto3";
    
    package spine.test.type;
    
    import "spine/options.proto";
    
    option (type_url_prefix) = "";
    option java_package = "io.spine.test.type";
    option java_outer_classname = "NoPrefixProto";
    option java_multiple_files = true;
    
    message TypeWithoutPrefix {
      string value = 1;
    }

    PR #588 provides more information on the matter.

  5. The Diags utility now provides additional Collectors for commonly used diagnostics.

    The new Diags.toEnumeration() joins the item's string representation with a comma followed by a space character.

    ImmutableList<String> list = ImmutableList.of("foo", "bar", "baz");
    String output = list.stream().collect(Diags.toEnumeration());
    System.out.println(output); // prints "foo, bar, baz"

    The Diags.toEnumerationBackticked wraps each item's string representation into backticks and then joins to the result string with a comma followed by a space character.

    ImmutableList<String> list = ImmutableList.of("foo", "bar", "baz");
    String output = list.stream().collect(Diags.toEnumerationBackticked());
    System.out.println(output); // prints "`foo`, `bar`, `baz`"

Fixes

  1. Gradle Proto Dart plugin now resolves relative imports. (see #572 and #573)

  2. Enum values now also support (distinct) validation options (see #437 and #587)

Infrastructure

  1. Spine Protoc plugin is now started by the Gradle Protobuf plugin without custom launch scripts (see #586 for details).

  2. Proto Dart plugin resolves the pub cache better with the new PubCache utility (see #589).

  3. The libraries now do not use implementation for compile-only annotations like errorprone annotations but use the newly introduced compileOnlyApi configuration for such dependencies (see #597).

Dependency upgrades

  • Checker framework: 3.3.0 -> 3.7.1
  • Error Prone: 2.3.4 -> 2.4.0
  • Error Prone Gradle plugin: 1.2.1 -> 1.3.0
  • Protubuf: 3.11.4 -> 3.13.0
  • Protobuf Gradle plugin: 0.8.12 -> 0.8.13
  • App Engine API: 1.9.79 -> 1.9.82
  • Guava: 29.0-jre -> 30.0-jre
  • jUnit 4: 4.12 -> 4.13.1
  • jUnit Jupiter: 5.6.2 -> 5.7.0
  • jUnit Platform: 1.6.2 -> 1.7.0
  • jUnit Pioneer: 0.4.2. -> 1.0.0
  • Truth: 1.0.1 -> 1.1
  • Java Poet: 1.12.1 -> 1.13.0
  • Auto Service: 1.0-rc6 -> 1.0-rc7
  • Animal Sniffer: 1.18 -> 1.19
  • OAuth JWT: 3.10.3 -> 3.11.0
  • AssertK: 0.22 -> 0.23
  • SLF4J: 1.7.29 -> 1.7.30

Compare v1.6.0 and v1.7.0.

1.6.0

09 Sep 12:47
d382587
Compare
Choose a tag to compare

This release brings numerous API improvements, as well as fixes and infrastructure updates to the framework.

API changes

Execution environment

  1. Custom environments support is introduced [#539, #542, #545].


The Environment now exposes API to register user-defined environment types.
This can be done by extending the EnvironmentType class:

public final class AwsLambda extends EnvironmentType {

    @Override
    public boolean enabled() {
        // ...
    }
}

Then, the environment can be registered to give the user ability to check if it's active at any given moment of time:

Environment.instance()
           .register(new AwsLambda());

// ...

if (Environment.instance().is(AwsLambda.class)) {
    this.sender = new AwsEmailSender();
}


The Spine framework provides two environments out of the box: Production and Tests.


  1. The io.spine.testing package is added to the list of known testing libraries. When it occurs in the class path, the environment will always be resolved to Tests [#544].


Protobuf Model definition

  1. (min), (max) and (range) constraints will now be verified to be the whole numbers when applied to a whole number field (int32, etc.) [#560].
  2. (is) and (every_is) options will now be applied simultaneously instead of (is) taking priority over (every_is) [#531].
  3. New tools are added for working with regex-es in Protobuf [#520].
  4. An (is_required) validation option is added for oneof group fields [#523].
  5. The spine.ui.Language enumeration is now defined and contains language codes defined by ISO 639-1 [#522].

Other

JSON parser will now ignore unknown fields, allowing easier data migrations between old/new Protobuf schemas [#518].

Fixes

  1. The Spine protoc plugin location process is simplified. This enables creation of composite builds for Spine-based projects [#559].
  2. Time is tweaked to provide identical behaviour on all platforms under Java 8 and Java 9+ [#554].
  3. The proper import resolution is implemented for the Dart client [#524].
  4. javax.annotations-api dependency is added to the project so the Spine protoc plugin can be run safely with Java 11 [#546].

Infrastructure

  1. Stricter Gradle task ordering is introduced to eliminate randomness in build execution and improve the process reliability [#562].
  2. The project build scripts are migrated to Kotlin [#532, #534].

1.5.0

08 Mar 13:56
610fc6f
Compare
Choose a tag to compare

This release includes numerous API updates and performance improvements.

The most noticeable are listed below.

  • Time.currentTime() now returns the time with microsecond precision. The values are emulated, increasing for each consequent call (#504, #512).
  • (constraint_for) is now supported by the Spine compiler (#505).
  • Support for the new Column API has been added to the Spine compiler (#508).
  • Logging API has been extended (#513).

For more details please navigate to the list of the closed pull requests and their descriptions.

1.3.0

17 Dec 19:45
441e772
Compare
Choose a tag to compare

This PR brings several API improvements to the library.

Notable changes:

  • A KnownMessage interface is introduced. It marks the messages that are generated with Spine Model Compiler and can provide their typeUrl() (#495).
  • The deprecated FieldPaths utility is now removed (#495).
  • A lot of third-party dependencies are updated to the newer version (#496).
  • The conversion routines in TypeConverter will now support the number-based EnumValue instances (#501).

1.2.0

07 Nov 16:01
639b451
Compare
Choose a tag to compare

This release includes several new features and some existing feature improvements for the library.

Notable changes:

  • The client based on Dart programming language is now available. The base is extended with Dart-related tools.
  • Several API improvements for precondition checks (#486, #487).
  • It is now allowed to disable the validating builders generation when using Spine Model Compiler (#493).
  • A new EntityState marker interface is introduced for proto messages that represent a state of an entity (#494).

1.1.2

26 Sep 16:29
9e3bc13
Compare
Choose a tag to compare

This release brings several improvements and bug fixes to the library.

Notable changes:

  • A new Field utility is introduced for working with Protobuf field paths. The new functionality mirrors and extends the existing FieldPaths utility which is now deprecated [#467].
  • Tests utility is extended with method halt() for failing on unexpected method calls [#464].
  • Stringifiers.toString(...) now correctly processes the enum values [#462].
  • Test utilities now use the latest release version of Google Truth. Minor backward compatibility issues may be expected at the users' end [#463].