Skip to content

Commit

Permalink
updated build scripts for empty features
Browse files Browse the repository at this point in the history
  • Loading branch information
zonyitoo committed Jun 21, 2021
1 parent 6583640 commit 3743ffe
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 33 deletions.
46 changes: 23 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions build/build-host-release
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,17 @@ HOST_TRIPLE=$(rustc -Vv | grep 'host:' | awk '{print $2}')
echo "Started build release ${VERSION} for ${HOST_TRIPLE} with features \"${BUILD_FEATURES}\"..."

if [[ "${BUILD_TARGET}" != "" ]]; then
cargo build --release --features "${BUILD_FEATURES}" --target "${BUILD_TARGET}"
if [[ "${BUILD_FEATURES}" != "" ]]; then
cargo build --release --features "${BUILD_FEATURES}" --target "${BUILD_TARGET}"
else
cargo build --release --target "${BUILD_TARGET}"
fi
else
cargo build --release --features "${BUILD_FEATURES}"
if [[ "${BUILD_FEATURES}" != "" ]]; then
cargo build --release --features "${BUILD_FEATURES}"
else
cargo build --release
fi
fi

if [[ "$?" != "0" ]]; then
Expand Down
15 changes: 14 additions & 1 deletion build/build-host-release.ps1
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
#!pwsh
<#
OpenSSL is already installed on windows-latest virtual environment.
If you need OpenSSL, consider install it by:
choco install openssl
#>
param(
[Parameter(HelpMessage = "extra features")]
[Alias('f')]
[string]$Features
)

$ErrorActionPreference = "Stop"

$TargetTriple = (rustc -Vv | Select-String -Pattern "host: (.*)" | ForEach-Object { $_.Matches.Value }).split()[-1]

Write-Host "Started building release for ${TargetTriple} ..."

cargo build --release
if ([string]::IsNullOrEmpty($Features)) {
cargo build --release
}
else {
cargo build --release --features "${Features}"
}

if (!$?) {
exit $LASTEXITCODE
}
Expand Down
15 changes: 11 additions & 4 deletions build/build-release
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,18 @@ function build() {
TARGET_FEATURES+=" local-redir"
fi

echo "* Building ${TARGET} package ${VERSION} with features \"${TARGET_FEATURES}\" ..."
if [[ "${TARGET_FEATURES}" != "" ]]; then
echo "* Building ${TARGET} package ${VERSION} with features \"${TARGET_FEATURES}\" ..."

cross build --target "${TARGET}" \
--features "${TARGET_FEATURES}" \
--release
cross build --target "${TARGET}" \
--features "${TARGET_FEATURES}" \
--release
else
echo "* Building ${TARGET} package ${VERSION} ..."

cross build --target "${TARGET}" \
--release
fi

if [[ $? != "0" ]]; then
exit $?
Expand Down
4 changes: 2 additions & 2 deletions crates/shadowsocks-service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "shadowsocks-service"
version = "1.11.1"
version = "1.11.2"
authors = ["Shadowsocks Contributors"]
description = "shadowsocks is a fast tunnel proxy that helps you bypass firewalls."
repository = "https://github.com/shadowsocks/shadowsocks-rust"
Expand Down Expand Up @@ -108,7 +108,7 @@ regex = "1.4"
serde = { version = "1.0", features = ["derive"] }
json5 = "0.3"

shadowsocks = { version = "1.11.1", path = "../shadowsocks" }
shadowsocks = { version = "1.11.2", path = "../shadowsocks" }

# Just for the ioctl call macro
[target.'cfg(any(target_os = "macos", target_os = "ios", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd"))'.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/shadowsocks/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "shadowsocks"
version = "1.11.1"
version = "1.11.2"
authors = ["Shadowsocks Contributors"]
description = "shadowsocks is a fast tunnel proxy that helps you bypass firewalls."
repository = "https://github.com/shadowsocks/shadowsocks-rust"
Expand Down

0 comments on commit 3743ffe

Please sign in to comment.