Skip to content

Commit

Permalink
Fix output name second attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
Mygod committed May 3, 2020
1 parent c5ce702 commit 833b35e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
branch = shadowsocks-android
[submodule "core/src/main/rust/shadowsocks-rust"]
path = core/src/main/rust/shadowsocks-rust
url = https://github.com/madeye/shadowsocks-rust
url = https://github.com/shadowsocks/shadowsocks-rust.git
3 changes: 2 additions & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ cargo {
"local-flow-stat",
"local-dns-relay"))
exec = { spec, toolchain ->
spec.environment("RUST_ANDROID_GRADLE_CC_LINK_ARG", "-o,target/${toolchain.target}/$profile/lib$libname.so")
spec.environment("RUST_ANDROID_GRADLE_LINKER_WRAPPER_PY", "$projectDir/$module/../linker-wrapper.py")
spec.environment("RUST_ANDROID_GRADLE_TARGET", "target/${toolchain.target}/$profile/lib$libname.so")
}
}

Expand Down
18 changes: 18 additions & 0 deletions core/src/main/rust/linker-wrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from __future__ import absolute_import, print_function, unicode_literals

import os
import pipes
import shutil
import subprocess
import sys

args = [os.environ['RUST_ANDROID_GRADLE_CC'], os.environ['RUST_ANDROID_GRADLE_CC_LINK_ARG']] + sys.argv[1:]

# This only appears when the subprocess call fails, but it's helpful then.
printable_cmd = ' '.join(pipes.quote(arg) for arg in args)
print(printable_cmd)

code = subprocess.call(args)
if code == 0:
shutil.copyfile(sys.argv[sys.argv.index('-o') + 1], os.environ['RUST_ANDROID_GRADLE_TARGET'])
sys.exit(code)
2 changes: 1 addition & 1 deletion core/src/main/rust/shadowsocks-rust
2 changes: 1 addition & 1 deletion mobile/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ dependencies {
implementation("com.google.zxing:core:3.4.0")
implementation("com.takisoft.preferencex:preferencex-simplemenu:1.1.0")
implementation("com.twofortyfouram:android-plugin-api-for-locale:1.0.4")
implementation("me.zhanghai.android.fastscroll:library:1.1.2")
implementation("me.zhanghai.android.fastscroll:library:1.1.3")
implementation("xyz.belvi.mobilevision:barcodescanner:2.0.3")
}
2 changes: 1 addition & 1 deletion repositories.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rootProject.extra.apply {
set("androidPlugin", "com.android.tools.build:gradle:4.1.0-alpha07")
set("androidPlugin", "com.android.tools.build:gradle:4.1.0-alpha08")
set("kotlinVersion", "1.3.72")
}

Expand Down

3 comments on commit 833b35e

@Mygod
Copy link
Contributor Author

@Mygod Mygod commented on 833b35e May 3, 2020

Choose a reason for hiding this comment

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

Hmm somehow CI build apk still does not contain libsslocal.so...

P.S. It's working perfectly fine on my local builds.

EDIT: Fixed via ea88609.

@madeye
Copy link
Contributor

@madeye madeye commented on 833b35e May 3, 2020

Choose a reason for hiding this comment

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

Nice hack!

@lushengen
Copy link

@lushengen lushengen commented on 833b35e May 5, 2020 via email

Choose a reason for hiding this comment

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

Please sign in to comment.