diff --git a/android/include/meson.build b/android/include/meson.build new file mode 100644 index 000000000..edcdc8283 --- /dev/null +++ b/android/include/meson.build @@ -0,0 +1,18 @@ +javac = find_program('javac') + +common_cppflags += '-I' + meson.current_build_dir() + +bridge_header = custom_target( + 'org_musicpd_Bridge.h', + output: 'org_musicpd_Bridge.h', + input: [ + '../app/src/main/java/org/musicpd/Bridge.java', + ], + command: [ + join_paths(meson.current_source_dir(), 'run-javac.sh'), + javac, + join_paths(android_sdk_platform_dir, 'android.jar'), + '@OUTDIR@', + '@INPUT@', + ], +) diff --git a/android/run-javac.sh b/android/include/run-javac.sh similarity index 68% rename from android/run-javac.sh rename to android/include/run-javac.sh index 2a113a721..22daf0c9d 100755 --- a/android/run-javac.sh +++ b/android/include/run-javac.sh @@ -2,11 +2,8 @@ JAVAC=$1 CLASSPATH=$2 -DIRNAME=$3 +GENINCLUDE=$3 -GENINCLUDE="$DIRNAME/include" - -mkdir -p "$GENINCLUDE" "$JAVAC" -source 1.8 -target 1.8 -Xlint:-options \ -cp "$CLASSPATH" \ -h "$GENINCLUDE" \ diff --git a/android/meson.build b/android/meson.build index 0ba6388f8..a9f88ec4b 100644 --- a/android/meson.build +++ b/android/meson.build @@ -14,21 +14,4 @@ android_sdk_platform_dir = join_paths(android_sdk, 'platforms', android_sdk_plat android_gradlew = join_paths(meson.current_source_dir(), 'gradlew') -javac = find_program('javac') - -common_cppflags += '-I' + join_paths(meson.current_build_dir(), 'include') - -bridge_header = custom_target( - 'org_musicpd_Bridge.h', - output: 'org_musicpd_Bridge.h', - input: [ - 'app/src/main/java/org/musicpd/Bridge.java', - ], - command: [ - join_paths(meson.current_source_dir(), 'run-javac.sh'), - javac, - join_paths(android_sdk_platform_dir, 'android.jar'), - '@OUTDIR@', - '@INPUT@', - ], -) +subdir('include')