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

Open
wants to merge 3 commits into
base: v3.0
Choose a base branch
from

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)

@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

Comment on lines +72 to +75
safeAddMavenPublication("jnigenPackageAndroid_arm64-v8a", project, mavenPublication, "natives-arm64-v8a");
safeAddMavenPublication("jnigenPackageAndroid_armeabi-v7a", project, mavenPublication, "natives-armeabi-v7a");
safeAddMavenPublication("jnigenPackageAndroid_x86", project, mavenPublication, "natives-x86");
safeAddMavenPublication("jnigenPackageAndroid_x86_64", project, mavenPublication, "natives-x86_64");
Copy link
Member

Choose a reason for hiding this comment

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

Can't we iterate over the AndroidABI enum? I don't really like it hard-coded

return targetsThatMatchOS;
}

public static void main (String[] args) {
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to keep the main?

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.

None yet

3 participants