Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: kotlin multi-platform [DHIS2-16221] #116

Merged
merged 72 commits into from
Jan 17, 2024
Merged

Conversation

jbee
Copy link
Contributor

@jbee jbee commented Nov 27, 2023

  • replaces @AutoValue with records (and interfaces for hierarchies)
  • replaces joda-time with java.time
  • replaces @Nullable with @CheckForNull and removes javax dependency
  • replaces used StringUtils.isEmpty with plain java and removes common lang dependency
  • replace assertj with vanilla junit
  • replace equalsverifier with vanilla junit (records do not need equals checked)
  • remove mockito dependency (was not needed any more)
  • replace slf4j with java.util.logging (was just some debug and error logging in one class)
  • removed apache commons util dependency (replaced with vanilla java)
  • replace Arrays.asList with List.of
  • move tests of expression parser internals to the expression parser repo (test: moved from rule engine repo expression-parser#35)
  • use kotlin MP JVM artefact of the expression parser

Any failing test that would only check that a factory method did throw a NPE for non-null arguments were removed as in kotlin we will have non-null types for these so no check or test is needed. The existing tests mainly confirmed a behaviour of @AutoValue that would generate null checks in the constructor for fields annotated with @Nonnull.

@jbee jbee self-assigned this Nov 27, 2023
@jbee
Copy link
Contributor Author

jbee commented Dec 8, 2023

@vgarciabnz
Copy link
Member

vgarciabnz commented Dec 13, 2023

Created the KMP structure. The version has been set to 3.0.0-SNAPSHOT.

The github action is configured to push a SNAPSHOT version on each PR. Publication to Maven Central has been disabled to avoid accidental publications during the refactor.

All the classes have added to jvmMain because of dependencies with Java classes. There are two classes added to commonMain just to make the common artifact non-empty (native build crashes if it is empty, it looks like a bug).

Pending Java classes to remove:

  • java.util.logging.Level
  • java.util.logging.Logger
  • java.text.SimpleDateFormat
  • java.util.Date
  • java.util.Locale
  • java.util.concurrent.Callable
  • java.util.Map
  • java.util.regex.Pattern

* refactor: Clean up description call to rule engine

* refactor: Clean up evaluation call to rule engine

* refactor: Clean up evaluation call to rule engine

* refactor: EventDate changed from LocalDate to Instant

* Refactor package structure

* Refactor package structure

* Fix RuleAction interface

* Fix RuleAction interface

* Fix RuleEngine API interface

* Make engine package internal

* Make rule engine getInstance static for Java

* Update build.gradle.kts
@enricocolasante enricocolasante marked this pull request as ready for review January 17, 2024 09:41
@enricocolasante enricocolasante merged commit c5c7085 into master Jan 17, 2024
2 checks passed
@enricocolasante enricocolasante deleted the mp-prepare branch January 17, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants