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

fix(build): 💊 make Android build script cross platform #1684

Merged
merged 4 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/cordova/android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ The main entrypoint to Android's Java code is `cordova-plugin-outline/android/ja
Additional requirements for Android:

- [Java Development Kit (JDK) 11](https://jdk.java.net/archive/)
- Set `JAVA_HOME` environment variable if you are building on Windows
- Latest [Android Sdk Commandline Tools](https://developer.android.com/studio/command-line) ([download](https://developer.android.com/studio#command-line-tools-only))
- Place it at `$HOME/Android/sdk/cmdline-tools/latest`
- Set `ANDROID_HOME` environment variable
- Android SDK 32 (with build-tools) via commandline `$HOME/Android/sdk/cmdline-tools/latest/bin/sdkmanager "platforms;android-32" "build-tools;32.0.0"`
- [Gradle 7.3+](https://gradle.org/install/)

Expand Down
15 changes: 8 additions & 7 deletions src/cordova/plugin/android/scripts/copy_third_party.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.

const child_process = require('child_process');
const fs = require('fs');
jyyi1 marked this conversation as resolved.
Show resolved Hide resolved

module.exports = function(context) {
console.log('Copying Android third party libraries...');
child_process.execSync('mkdir -p plugins/cordova-plugin-outline/android/libs');
child_process.execSync(
`cp third_party/outline-go-tun2socks/android/tun2socks.aar plugins/cordova-plugin-outline/android/libs/`
);
child_process.execSync(
`cp -R third_party/outline-go-tun2socks/android/jni plugins/cordova-plugin-outline/android/libs/obj`
fs.mkdirSync('plugins/cordova-plugin-outline/android/libs', {recursive: true});
fs.copyFileSync(
'third_party/outline-go-tun2socks/android/tun2socks.aar',
jyyi1 marked this conversation as resolved.
Show resolved Hide resolved
'plugins/cordova-plugin-outline/android/libs/tun2socks.aar'
);
fs.cpSync('third_party/outline-go-tun2socks/android/jni', 'plugins/cordova-plugin-outline/android/libs/obj', {
recursive: true,
});
};
Loading