Commit Graph

573 Commits

Author SHA1 Message Date
Josh Tynjala
763b982bd1 HTML5Helper: use bundled terser, but also add optional -npx flag to use npx version 2023-05-16 12:45:29 -07:00
Josh Tynjala
802472cee6 update ancient bundled Node.js to 18.16.0 LTS 2023-05-16 12:34:23 -07:00
Josh Tynjala
ed3d7efe19 Merge branch 'develop' into 8.1.0-Dev 2023-04-24 09:52:11 -07:00
player-03
ee4bcb5b65 Merge pull request #1604 from MAJigsaw77/patch-2
Use `getDisplayMetrics()` to find screen DPI on Android.
2023-04-16 14:51:12 -04:00
Josh Tynjala
589712e29f ApplicationMain: ensure that AIR window initial title is populated
Was incorrectly being set to Lime Application instead
2023-03-15 14:50:47 -07:00
Josh Tynjala
cebe8dff82 Merge branch 'develop' into 8.1.0-Dev 2023-02-22 08:52:43 -08:00
Joseph Cloutier
c44e292a06 Use applicationDirectory to locate assets.
`programPath()` returns the directory of the executable, but that isn't
always the asset root. (Notably, in the case of Mac apps.)
2023-01-13 21:19:52 -05:00
player-03
43fb0f15c5 Merge pull request #1500 from player-03/DeprecatedGradleFeatures
Fix warnings and errors in the Android build process
2022-12-29 19:26:54 -05:00
player-03
61dd0629be Use getDisplayMetrics().
`getRealMetrics()` is now deprecated as well. It suggests using `getCurrentWindowMetrics()` instead, but that's new in SDK 30 and doesn't even contain DPI information. Whereas this function has been around since the start.
2022-12-20 14:29:37 -05:00
arm32x
162b5da2c3 Stop linking with liblinuxcompat.a
This library used to be provided by HXCPP, but it was removed in version
3.4.185. Fortunately, it doesn't seem to be necessary, so this commit
stops Lime from attempting to link with it.
2022-11-30 11:37:04 -05:00
Mihai Alexandru
b5d6db38a7 Update GameActivity.java 2022-11-27 08:19:34 +02:00
Mihai Alexandru
d8237ff50b Update GameActivity.java 2022-11-25 21:53:49 +02:00
player-03
63d2f896fb Merge pull request #1597 from player-03/remove_kha
Remove the defunct Kha backend.
2022-11-18 14:07:20 -05:00
Joseph Cloutier
1546e826c2 Remove the defunct Kha backend. 2022-11-14 12:14:22 -05:00
player-03
76e1df8ef4 Merge pull request #1538 from player-03/programPath
Allow running native apps from other directories.
2022-10-10 13:35:54 -04:00
Josh Tynjala
5b3641e78f Fix command line arguments not being passed to HashLink on macOS 2022-10-10 09:40:08 -07:00
player-03
cbded74b42 Merge pull request #1529 from arm32x/fix/static-debug-build
Fix `Main.cpp` template for `-static` `-debug` builds
2022-09-07 14:12:32 -04:00
Joseph Cloutier
4634755a56 Disable pointer tagging.
(For real this time.)

https://source.android.com/docs/security/test/tagged-pointers
2022-09-07 14:00:52 -04:00
Joseph Cloutier
ab8e479abf Merge branch 'develop' into DeprecatedGradleFeatures 2022-09-03 18:36:04 -04:00
player-03
f38119d181 Merge branch 'develop' into rootPath-improvements 2022-09-03 15:22:26 -04:00
Josh Tynjala
fd0fc3da48 HashLink: fix the ability to double-click the .app file on macOS to run it
The HashLink executable expects hlboot.dat and libraries to be in the current working directory (it's not enough for them to be in the same directory as the executable). Make the .app file launch a shell script that 1) changes the current working directory 2) launches the HashLink executable
2022-07-13 10:01:57 -07:00
player-03
4f83af5848 Merge pull request #1545 from player-03/configChanges
Suppress `uiMode` configuration changes.
2022-06-27 01:49:18 -04:00
Josh Tynjala
e3a755ff60 ManifestResources: use Dynamic instead of AssetLibrary when disable_preloader_assets is defined 2022-06-14 07:41:50 -07:00
Josh Tynjala
4e1974fc9f ManifestResources: if disable_preloader_assets is defined, keep the public API available
Ensures that existing custom templates still work
2022-06-14 07:07:22 -07:00
Joseph Cloutier
9a81ae8798 Merge branch 'develop' into DeprecatedGradleFeatures 2022-06-12 10:00:23 -04:00
Joseph Cloutier
bb9b64af81 Suppress uiMode configuration changes.
When the user switches between dark and light themes, Android destroys
and recreates the activity. However, Lime activities can't be recreated
like this, and just close instead.

Since we don't actually use the system theme, there's no reason to do
this. Simplest solution is to suppress it.

https://developer.android.com/guide/topics/resources/runtime-changes
https://developer.android.com/guide/topics/ui/look-and-feel/darktheme#config-changes
2022-06-11 20:28:41 -04:00
Joseph Cloutier
5ffbfd7f3a Add AndroidX options to <config:android />.
`enableJetifier` defaults to false because it can slow compilation.
2022-06-11 20:20:33 -04:00
Joseph Cloutier
00fd063026 Use implementation instead of api.
This is recommended as a best practice, though AFAIK this only matters
for projects that are going to be imported by other projects.

For instance, you used to be able to include `:deps:extension-api` by
including any extension that depended on it. Now, every project that
wants to use `extension-api` has to include it directly. (Which is fine
because in practice, they all already do so.)
2022-06-11 20:10:34 -04:00
Joseph Cloutier
619b67b472 Remove reference to nonexistant folder.
libs/ doesn't exist; only app/libs/ does, and that's handled by app/build.gradle.
2022-06-11 20:10:34 -04:00
Joseph Cloutier
1ff434043c Remove trailing spaces. 2022-06-11 20:09:42 -04:00
Joseph Cloutier
0e6bfa830b Allow running native apps from other directories.
It isn't always safe to assume `./` is the app directory, and removing
that assumption opens up options.

Requires at least Haxe 3.4, but I don't think Lime supports 3.3 anyway.
2022-06-07 11:47:18 -04:00
Joseph Cloutier
46acd3b373 Target Android API level 30.
https://developer.android.com/distribute/best-practices/develop/target-sdk
2022-06-05 22:38:48 -04:00
Joseph Cloutier
8bcbafd587 Update the Android Gradle Plugin. 2022-06-05 22:38:08 -04:00
Joseph Cloutier
96bfa805cf Add instructions to debug Java classes.
The Java compiler complains about deprecated features and unsafe
operations, but it's surprisingly hard to get the details. Here's how.
2022-06-05 22:37:07 -04:00
Joseph Cloutier
87611eeed1 Remove uses-sdk tag.
This is now redundant, and sometimes even causes builds to fail.
2022-06-05 22:37:07 -04:00
Joseph Cloutier
f81439d1d2 Use androidX when available.
https://developer.android.com/jetpack/androidx/
2022-06-05 22:37:07 -04:00
Joseph Cloutier
ded22af195 Replace references to jcenter().
https://developer.android.com/studio/build/jcenter-migration

Gradle considers this function a "deprecated feature."
2022-06-05 22:37:07 -04:00
Joseph Cloutier
fa7f487595 Replace ndk.dir with ndkPath.
https://developer.android.com/studio/projects/configure-agp-ndk#agp_version_41

The documentation tells you to be careful about this, since you're
putting local-only information into a file that gets uploaded to version
control, but Lime doesn't really need to worry about that.

Granted, Lime DID use local.properties, but that's no longer practical.
2022-06-05 22:37:07 -04:00
player-03
2cd7161bbe Don't expect Android extensions to use ndlls
I can't think of any practical reasons for an Android extension to compile an ndll. All of Android's system functions require Java, not C++, and you can get the speed of C++ just by writing Haxe code.

I surveyed several Android extensions on lib.haxe.org, and not one of them used ndlls when targeting Android.
2022-06-05 22:36:01 -04:00
player-03
276a8f6c8a Merge pull request #1517 from Apprentice-Alchemist/feature/update-hashlink
Update hashlink.
2022-06-02 18:34:19 -04:00
Igor
dec38dcc97 Required for apps targeting Android 12+
Otherwise it throws the following error on build:
"Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details."

To publish apps on Google Play everyone needs to target SDK 31+, which is Android 12+, so this is like a must now.

If "true", the activity is accessible to any app, and is launchable by its exact class name.
If "false", the activity can be launched only by components of the same application, applications with the same user ID, or privileged system components. This is the default value when there are no intent filters.
2022-05-26 16:19:03 -04:00
Apprentice-Alchemist
ad70700a14 Try to fix Windows mess a bit.
Default to 64 bit on windows too.
2022-05-19 20:46:08 +02:00
arm32x
3c4ddbab17 Fix Main.cpp template for -static -debug builds
When building a Lime application in debug mode on Windows, the console
subsystem is used and Windows looks for a 'main' function. However, the
Main.cpp file used when linking statically always defines a 'WinMain'
function regardless of whether the application is being built in debug
mode.

This commit adds an additional check in the Main.cpp that defines a
'main' function instead of 'WinMain' when building in debug mode.
2022-05-04 13:10:13 -04:00
Apprentice-Alchemist
a44fe3669a Put hashlink binaries in templates/bin again.
Add setup script for macOS codesigning.
2022-04-28 19:42:45 +02:00
Apprentice-Alchemist
a3b3d8593f Update hashlink. 2022-04-28 19:42:40 +02:00
Apprentice-Alchemist
daca1a2a62 Update hashlink. 2022-04-28 19:42:39 +02:00
Josh Tynjala
da3705ed20 Electron: update to latest version 18
-lib hxnodejs is no longer included in the compilation of ApplicationMain (but it is still included for compilation of ElectronSetup, of course). hxnodejs was removed from ApplicationMain because it forces some require() calls to be included in the generated .js, which would require disabling certain Electron security features to work properly in newer versions of Electron than we targeted previously. Electron's documentation recommends not to do that.

To use Node.js APIs, you need to run them in more secure contexts, while communicating over IPC with a "preload script" from the "renderer" process. In Lime/OpenFL, this would require a custom ElectronSetup template override, but that shouldn't be all that surprising. See: https://www.electronjs.org/docs/latest/tutorial/process-model for more details on the Electron side.
2022-04-14 12:08:58 -07:00
player-03
8ab755d359 Merge pull request #1497 from player-03/gitignore-obj
Ignore project/obj in extensions.
2021-12-20 10:03:45 -05:00
Josh Tynjala
0ecf27d2d6 disable_preloader_assets haxedef
When the project contains no assets, excludes asset-related classes for big file size savings
2021-11-18 10:46:07 -08:00
player-03
dc637ca98c Ignore project/obj in extensions.
No one ever wants to include the intermediate build files. However, some choose to include the outputs, so I left them as comments.
2021-11-07 12:33:47 -05:00