Skip to content

Commit 3743ffe

Browse files
committed
updated build scripts for empty features
1 parent 6583640 commit 3743ffe

File tree

6 files changed

+61
-33
lines changed

6 files changed

+61
-33
lines changed

Cargo.lock

+23-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/build-host-release

+10-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,17 @@ HOST_TRIPLE=$(rustc -Vv | grep 'host:' | awk '{print $2}')
2525
echo "Started build release ${VERSION} for ${HOST_TRIPLE} with features \"${BUILD_FEATURES}\"..."
2626

2727
if [[ "${BUILD_TARGET}" != "" ]]; then
28-
cargo build --release --features "${BUILD_FEATURES}" --target "${BUILD_TARGET}"
28+
if [[ "${BUILD_FEATURES}" != "" ]]; then
29+
cargo build --release --features "${BUILD_FEATURES}" --target "${BUILD_TARGET}"
30+
else
31+
cargo build --release --target "${BUILD_TARGET}"
32+
fi
2933
else
30-
cargo build --release --features "${BUILD_FEATURES}"
34+
if [[ "${BUILD_FEATURES}" != "" ]]; then
35+
cargo build --release --features "${BUILD_FEATURES}"
36+
else
37+
cargo build --release
38+
fi
3139
fi
3240

3341
if [[ "$?" != "0" ]]; then

build/build-host-release.ps1

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
1+
#!pwsh
12
<#
23
OpenSSL is already installed on windows-latest virtual environment.
34
If you need OpenSSL, consider install it by:
45
56
choco install openssl
67
#>
8+
param(
9+
[Parameter(HelpMessage = "extra features")]
10+
[Alias('f')]
11+
[string]$Features
12+
)
13+
714
$ErrorActionPreference = "Stop"
815

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

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

13-
cargo build --release
20+
if ([string]::IsNullOrEmpty($Features)) {
21+
cargo build --release
22+
}
23+
else {
24+
cargo build --release --features "${Features}"
25+
}
26+
1427
if (!$?) {
1528
exit $LASTEXITCODE
1629
}

build/build-release

+11-4
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,18 @@ function build() {
4949
TARGET_FEATURES+=" local-redir"
5050
fi
5151

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

54-
cross build --target "${TARGET}" \
55-
--features "${TARGET_FEATURES}" \
56-
--release
55+
cross build --target "${TARGET}" \
56+
--features "${TARGET_FEATURES}" \
57+
--release
58+
else
59+
echo "* Building ${TARGET} package ${VERSION} ..."
60+
61+
cross build --target "${TARGET}" \
62+
--release
63+
fi
5764

5865
if [[ $? != "0" ]]; then
5966
exit $?

crates/shadowsocks-service/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "shadowsocks-service"
3-
version = "1.11.1"
3+
version = "1.11.2"
44
authors = ["Shadowsocks Contributors"]
55
description = "shadowsocks is a fast tunnel proxy that helps you bypass firewalls."
66
repository = "https://github.com/shadowsocks/shadowsocks-rust"
@@ -108,7 +108,7 @@ regex = "1.4"
108108
serde = { version = "1.0", features = ["derive"] }
109109
json5 = "0.3"
110110

111-
shadowsocks = { version = "1.11.1", path = "../shadowsocks" }
111+
shadowsocks = { version = "1.11.2", path = "../shadowsocks" }
112112

113113
# Just for the ioctl call macro
114114
[target.'cfg(any(target_os = "macos", target_os = "ios", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd"))'.dependencies]

crates/shadowsocks/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "shadowsocks"
3-
version = "1.11.1"
3+
version = "1.11.2"
44
authors = ["Shadowsocks Contributors"]
55
description = "shadowsocks is a fast tunnel proxy that helps you bypass firewalls."
66
repository = "https://github.com/shadowsocks/shadowsocks-rust"

0 commit comments

Comments
 (0)