1 Star 0 Fork 0

taiji1986/BridJ

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CheckPackages 2.78 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
function failIfHas {
grep "$1" > /dev/null && ( echo "$2" ; exit 1 )
}
function fail {
echo "$@"
exit 1
}
for F in target/bridj*.jar ; do
if [[ ! $F =~ .*(javadoc|sources).* ]]; then
echo ""
echo $F
CONTENTS=`unzip -l $F`
echo "$CONTENTS" | grep org/bridj/BridJ.class > /dev/null || fail "Does not have BridJ"
ANDROID_CLASSES="DexFormat AndroidClassDefiner AndroidSupport"
if [[ $F =~ .*android.* ]]; then
for CLS in $ANDROID_CLASSES; do
echo "$CONTENTS" | grep $CLS.class > /dev/null || fail "Does not have class $CLS"
echo " Has class $CLS"
done
echo "$CONTENTS" | egrep "\.so|\.dll|\.dylib" && fail "Android jar should not have binaries"
else
for CLS in $ANDROID_CLASSES; do
echo "$CONTENTS" | grep $CLS.class > /dev/null && fail " Has class $CLS"
done
echo "$CONTENTS" | grep -i Android && fail " Has some android references"
echo "$CONTENTS" | egrep "\.so|\.dll|\.dylib" || exit 1
fi
if [[ $F =~ .*unix-only.* ]]; then
echo "$CONTENTS" | egrep "/(mfc|com)/" && fail " Has windows-only classes"
for FLAVOUR in linux_ sunos_ darwin_ ; do
echo "$CONTENTS" | grep $FLAVOUR || fail " Has no resource matching $FLAVOUR"
done
fi
if [[ $F =~ .*windows-only.* ]]; then
echo "$CONTENTS" | egrep "/mfc/" || fail " Has no MFC classes"
echo "$CONTENTS" | egrep "/com/" || fail " Has no COM classes"
echo "$CONTENTS" | egrep "linux_|sunos_|darwin_|ndroid" && fail " Has unix resources"
fi
if [[ $F =~ .*c-only.* ]]; then
echo "$CONTENTS" | egrep "/(cpp|objc)/" && fail " Has non-windows content"
fi
echo "$CONTENTS" | grep junit && fail " Has JUnit"
fi
done
echo ""
echo "Analyzing android zip"
CONTENTS=`unzip -l target/bridj-*-android.zip`
echo "$CONTENTS" | grep libs/ | grep '\.'
echo "$CONTENTS" | grep 'LICENSE.BridJ.txt' > /dev/null || fail "Does not have LICENSE"
echo "$CONTENTS" | grep 'README.BridJ.txt' > /dev/null || fail "Does not have README"
echo "$CONTENTS" | grep 'libs/bridj-.*-android.jar' > /dev/null || fail "Does not have BridJ JAR"
echo "$CONTENTS" | grep 'libs/bridj-.*-android.jar.properties' > /dev/null || fail "Does not have BridJ JAR properties"
echo "$CONTENTS" | grep 'libs/docs/bridj-.*-sources.jar' > /dev/null || fail "Does not have BridJ sources JAR"
echo "$CONTENTS" | grep 'libs/docs/bridj-.*-javadoc.jar' > /dev/null || fail "Does not have BridJ javadoc JAR"
for ABI in x86 armeabi; do
echo "$CONTENTS" | grep "libs/$ABI/libbridj.so" > /dev/null || fail "Does not have $ABI binary"
done
echo "
SUCCESS
"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/yangtf/BridJ.git
[email protected]:yangtf/BridJ.git
yangtf
BridJ
BridJ
master

搜索帮助