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

Killing Ant. Replacing with java support for executing compilation linking and packaging. Also MSVC toolchain target #69

Merged
merged 37 commits into from
Oct 16, 2024

Conversation

Tom-Ski
Copy link
Member

@Tom-Ski Tom-Ski commented Jun 23, 2024

Ant kill
Ant is pretty annoying to maintain, and restrictive for things that we want to do, like separating out build targets for ios sim/device targets. No more ant scripts! All of it can be done logically in jnigen api to be executed via code/gradle.

MSVC support
Motivation for this:
Some third party libraries that don't expose source, or are too highly chained to MSVC make it impossible to use with jnigen, due to abi differences and name mangling not being compatible with mingw etc cross compilers on windows. As a fix for this, we can have a separate MSVC build target, so we can still have jni bindings that can target the same code base but just with a different build backend for when libs/source of external libraries are only MSVC compatible.

Features/Changes

  • Ant killed, replaced with build processes directly in jnigen
  • MSVC support added for windows targets
  • CompilerABI type - gcc/msvc
  • TargetType - device/simulator (ios only really)
  • Refactored Gradle plugin for some cleaner less confusing methods of configuring
  • Extract out global properties into build config, such as xcframework properties/version etc
  • Refactored so BuildTarget is specific to an arch/bitness/target type unit.
  • Ability to target specific ios slices with different configurations
  • Remove abi from global configs on BuildTarget as now is a property of adding an android target.
  • Add defaults to android/ios to build all default targets if we don't need to customize per slice/abi
  • Gradle task of jnigenGHA, which generates a handy github workflow to build cross platform
  • Gradle tasks are split into jnigen, (build jni structure and cpp files), build (compile and link), and package (bundle into jars)
  • Multithreading compilation support

Todos after merging c gen PR

  • Check 16k android
  • Artifact publishing
  • Optional packaging, hard errors in CI (Gha can add this)
  • Hook commented tasks back up

@Tom-Ski Tom-Ski changed the title MSVC support for windows targets Killing Ant. Replacing with java support for executing compilation linking and packaging. Also MSVC toolchain target Jun 28, 2024
@Tom-Ski Tom-Ski added this to the 3.0.0 milestone Jul 4, 2024
@Tom-Ski Tom-Ski changed the base branch from master to v3.0 July 9, 2024 17:47
@Tom-Ski Tom-Ski marked this pull request as ready for review July 9, 2024 17:55
@Tom-Ski Tom-Ski requested a review from a team as a code owner July 9, 2024 17:55
@Tom-Ski
Copy link
Member Author

Tom-Ski commented Jul 9, 2024

@PokeMMO @SimonIT @Berstanio this is ready for a review now, I've added a list of all the things that have changed in this in the PR description

@badlogic
Copy link
Member

badlogic commented Jul 9, 2024

How bout our lord and savior CMake? :p

@badlogic
Copy link
Member

badlogic commented Jul 10, 2024 via email

Copy link
Contributor

@Berstanio Berstanio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another thing I notices, where I don't really figure out easily why, jnigenPackageAndroid_xxx still packages all android abis. But not really an issue

@Berstanio Berstanio linked an issue Jul 16, 2024 that may be closed by this pull request
@Tom-Ski Tom-Ski changed the base branch from v3.0 to master October 8, 2024 21:03
@@ -40,80 +41,6 @@
* @author Nathan Sweet */
public class SharedLibraryLoader {

static public Os os;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we maybe want to retain these fields, mark them as deprecated and just do:
static public Os os = HostDetection.os;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, would make adoption a bit easier

@Tom-Ski Tom-Ski merged commit 2c145ba into master Oct 16, 2024
6 checks passed
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.

Android ignores libraries field
4 participants