mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 01:41:18 -10:00
Compare commits
394
Commits
compression
...
2.10.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b60927f21f | ||
|
|
a77fdbe8b5 | ||
|
|
81f2bb71ed | ||
|
|
3d1b4715eb | ||
|
|
df12cf48c6 | ||
|
|
4e37530b60 | ||
|
|
95513a6be4 | ||
|
|
8415e77fbe | ||
|
|
3e593ba735 | ||
|
|
ddd9443f26 | ||
|
|
d0c67f7e87 | ||
|
|
b2e391a309 | ||
|
|
3d4f602354 | ||
|
|
2b62b097df | ||
|
|
b816837188 | ||
|
|
c084efc79e | ||
|
|
07791b1406 | ||
|
|
9ba41cadd2 | ||
|
|
ca02c72ecb | ||
|
|
f5b2849d72 | ||
|
|
8c4808fc36 | ||
|
|
ed23f897c4 | ||
|
|
b636b093d2 | ||
|
|
e433c33f9f | ||
|
|
21528f97be | ||
|
|
a7c3c38901 | ||
|
|
5766da53da | ||
|
|
3e6f82d10c | ||
|
|
01e4a9bb55 | ||
|
|
e09f898428 | ||
|
|
1d3ed22ab2 | ||
|
|
abdc66ca35 | ||
|
|
affd549250 | ||
|
|
a98ce10d71 | ||
|
|
432ed84634 | ||
|
|
b2eaffda65 | ||
|
|
78a1ca7417 | ||
|
|
7372ca74ef | ||
|
|
97bc578e86 | ||
|
|
adc1bd510c | ||
|
|
5ef11410bd | ||
|
|
843a59e2ab | ||
|
|
9bd2159a5f | ||
|
|
0b63e96ade | ||
|
|
17a13200f8 | ||
|
|
b48e7b5988 | ||
|
|
ba4c090467 | ||
|
|
b9b1ae5876 | ||
|
|
223d09ec41 | ||
|
|
e72dcebf98 | ||
|
|
980810dc82 | ||
|
|
6d7b16c0d2 | ||
|
|
d8d5da5c30 | ||
|
|
931c55c115 | ||
|
|
dcd3787a52 | ||
|
|
995d298d00 | ||
|
|
582c628f21 | ||
|
|
10e94f0efa | ||
|
|
f45ca2b65e | ||
|
|
c9231c0248 | ||
|
|
b5491e25d9 | ||
|
|
ea0673de2b | ||
|
|
f8d7872cc4 | ||
|
|
ead615dca5 | ||
|
|
4ed4702907 | ||
|
|
be750c099d | ||
|
|
4b82e7b3b2 | ||
|
|
1e17218a2d | ||
|
|
423f895412 | ||
|
|
d6070f1383 | ||
|
|
f1e818a76f | ||
|
|
a28a9520b5 | ||
|
|
6907827b05 | ||
|
|
6ea68b9128 | ||
|
|
7c37c423e1 | ||
|
|
8854623440 | ||
|
|
7b088dc2a4 | ||
|
|
e19f4be52c | ||
|
|
20b58344cc | ||
|
|
c310cd6556 | ||
|
|
fc074bb4fa | ||
|
|
a7bfba4549 | ||
|
|
a65b6c7523 | ||
|
|
7730c00a02 | ||
|
|
675dc5b693 | ||
|
|
881d960b29 | ||
|
|
6c161687ea | ||
|
|
7acea3000f | ||
|
|
a615812280 | ||
|
|
7ec51b02e9 | ||
|
|
9b5ca2f366 | ||
|
|
f4edc478f0 | ||
|
|
ba0fbbe133 | ||
|
|
86fdd99f9e | ||
|
|
6390cf3b64 | ||
|
|
fcdb18822c | ||
|
|
79fddfa11d | ||
|
|
32f616acfb | ||
|
|
52e0febfe6 | ||
|
|
4246c386a0 | ||
|
|
d4ed08b5b4 | ||
|
|
e43d097f7c | ||
|
|
1066c2c1b5 | ||
|
|
efa462d684 | ||
|
|
6a77ef2687 | ||
|
|
1829c15ee9 | ||
|
|
c214cd9488 | ||
|
|
d08d05e197 | ||
|
|
0793c8ecae | ||
|
|
2031d77d6b | ||
|
|
916479ff8a | ||
|
|
1630b8ecb9 | ||
|
|
1316be56bb | ||
|
|
e61f3b7278 | ||
|
|
b6b34d1051 | ||
|
|
c5cbc7e8e2 | ||
|
|
3aad1fb2cf | ||
|
|
c3cd3eb877 | ||
|
|
610f8d77c9 | ||
|
|
18efb9a9e2 | ||
|
|
11b3ead24e | ||
|
|
dfcd93df2a | ||
|
|
ee701df195 | ||
|
|
142676a516 | ||
|
|
02f2fe8204 | ||
|
|
be6ba4038a | ||
|
|
9d4e229c2e | ||
|
|
9177ddc384 | ||
|
|
b9c4865b04 | ||
|
|
83c2b73c8c | ||
|
|
77b6d414b9 | ||
|
|
cb8913217e | ||
|
|
c45dd61269 | ||
|
|
2990e2e271 | ||
|
|
7e69d0aa77 | ||
|
|
cf0928b53e | ||
|
|
b2525e0cb0 | ||
|
|
38fe929b9f | ||
|
|
f5ef8da8e5 | ||
|
|
20453fcb9c | ||
|
|
f3ddd9df63 | ||
|
|
68ce0748e5 | ||
|
|
34fad98bf0 | ||
|
|
176c92c21d | ||
|
|
a303481db4 | ||
|
|
e2884a6c57 | ||
|
|
be19163ffe | ||
|
|
44a9e7eef7 | ||
|
|
ab26a0788e | ||
|
|
0870ad290d | ||
|
|
c4c9b57b9d | ||
|
|
184d565783 | ||
|
|
84c27ca818 | ||
|
|
561ec9f0e6 | ||
|
|
cf586923d5 | ||
|
|
be5559c59f | ||
|
|
97a48b0eab | ||
|
|
fbc54c3de5 | ||
|
|
e99c8b5a77 | ||
|
|
6eca3e53ed | ||
|
|
d1ef6f2e4b | ||
|
|
0ab1c82223 | ||
|
|
dd8a1f2831 | ||
|
|
632a3c70c7 | ||
|
|
6b9347a35b | ||
|
|
ccedbc64dc | ||
|
|
a962434e90 | ||
|
|
129cfd47ee | ||
|
|
1c51463ed0 | ||
|
|
719afa9b59 | ||
|
|
8f45703547 | ||
|
|
d47a028ed4 | ||
|
|
568f9ab996 | ||
|
|
c7f2fda73d | ||
|
|
c139a0e52d | ||
|
|
320645f312 | ||
|
|
8b1e1255e6 | ||
|
|
a96d068321 | ||
|
|
a5f9b5d9c6 | ||
|
|
fe7386298f | ||
|
|
db64c7f8f1 | ||
|
|
63f4b4cdd4 | ||
|
|
0efd1e04f6 | ||
|
|
b4e49b89b4 | ||
|
|
bf12c6eb03 | ||
|
|
15514b1b26 | ||
|
|
8dba556993 | ||
|
|
a40312f1c1 | ||
|
|
ca201f3478 | ||
|
|
e7785a27ab | ||
|
|
fd57b963ad | ||
|
|
88bfc71d89 | ||
|
|
efcd37f730 | ||
|
|
b27182bd5d | ||
|
|
e44310c079 | ||
|
|
5d7723bc37 | ||
|
|
157111dbb5 | ||
|
|
38bdb82f95 | ||
|
|
0a8a210791 | ||
|
|
ca0ededdc6 | ||
|
|
79633ee3d1 | ||
|
|
0577648c00 | ||
|
|
8cc7997a69 | ||
|
|
1258d11fc3 | ||
|
|
b5da420c28 | ||
|
|
879cb82456 | ||
|
|
15aed192fb | ||
|
|
789c5a7f91 | ||
|
|
684266d2b3 | ||
|
|
c5302b7b52 | ||
|
|
fc0ec2635d | ||
|
|
2d13b63f4e | ||
|
|
b057032956 | ||
|
|
a11120ae36 | ||
|
|
b56b8ad2c3 | ||
|
|
0b17f7feab | ||
|
|
abf855afe1 | ||
|
|
af6065a810 | ||
|
|
9cffdf6cf4 | ||
|
|
5a862ae52a | ||
|
|
07b052d9c6 | ||
|
|
70adac78be | ||
|
|
51a4f125d1 | ||
|
|
8e4b73cb4a | ||
|
|
e0dd2115d6 | ||
|
|
54fe90cf1c | ||
|
|
abc793ffbd | ||
|
|
d23601d20b | ||
|
|
2151a961f8 | ||
|
|
b8bf630538 | ||
|
|
77f13bc288 | ||
|
|
dead19bc1e | ||
|
|
ef2c84591a | ||
|
|
30f5e30bc4 | ||
|
|
cdd5b3f397 | ||
|
|
4512ede1a0 | ||
|
|
fb6c06445f | ||
|
|
d2fddf5062 | ||
|
|
ae3683b3c2 | ||
|
|
36d4336429 | ||
|
|
51a47770f2 | ||
|
|
c0a4dd98cf | ||
|
|
27729c4b20 | ||
|
|
c7f33c1904 | ||
|
|
eb3626b925 | ||
|
|
acba62755d | ||
|
|
e62983964b | ||
|
|
93966536b5 | ||
|
|
9aa0d0ba0b | ||
|
|
e984af0443 | ||
|
|
97c46a7be6 | ||
|
|
7d5fce6c1b | ||
|
|
3d19f5b624 | ||
|
|
16669c9944 | ||
|
|
a8f4de0f37 | ||
|
|
ad8508c148 | ||
|
|
081dc45b72 | ||
|
|
b0f9fd65a1 | ||
|
|
f995310582 | ||
|
|
5789f96b3c | ||
|
|
e413cf2327 | ||
|
|
bbd7f83168 | ||
|
|
dcad2f1b22 | ||
|
|
e9f180be6a | ||
|
|
8c3c6c4b54 | ||
|
|
f97c2388cb | ||
|
|
1e0d0e7c4c | ||
|
|
f96a9873cc | ||
|
|
b10086345e | ||
|
|
77a05371b4 | ||
|
|
ff1caafd97 | ||
|
|
d1eb847ef2 | ||
|
|
6e268ac849 | ||
|
|
8f69b0e0e0 | ||
|
|
d70c578fc4 | ||
|
|
7ee94c1ca3 | ||
|
|
8db070aae1 | ||
|
|
bc326d8e73 | ||
|
|
7c3bd246b6 | ||
|
|
1f40d73cdf | ||
|
|
b364173319 | ||
|
|
f1acca540b | ||
|
|
98c4b8992d | ||
|
|
591be8a33f | ||
|
|
f5b9efc784 | ||
|
|
d607d23767 | ||
|
|
1b4eee0534 | ||
|
|
784198d66a | ||
|
|
77908fc88a | ||
|
|
9bcbd52f03 | ||
|
|
b57515aa5a | ||
|
|
2d2834e4bc | ||
|
|
a87db25252 | ||
|
|
450b15885d | ||
|
|
3fc9d42ca0 | ||
|
|
e50fc47fd5 | ||
|
|
234a2d72e8 | ||
|
|
38e5ecca9f | ||
|
|
7dabffd212 | ||
|
|
9e14e62935 | ||
|
|
54b00f3630 | ||
|
|
6e81152a98 | ||
|
|
6593ea7a5e | ||
|
|
70feb6a2b3 | ||
|
|
93f8f61c8a | ||
|
|
cef819966a | ||
|
|
8b52311dfd | ||
|
|
faac64a083 | ||
|
|
0e29d1e39b | ||
|
|
ef3bdc76c2 | ||
|
|
ec98a692a1 | ||
|
|
a1681e5ee3 | ||
|
|
962fedd1e6 | ||
|
|
5920237751 | ||
|
|
788535030b | ||
|
|
48f3edb3cd | ||
|
|
e235e72884 | ||
|
|
3a1ae308b8 | ||
|
|
f1c1e02c38 | ||
|
|
43937146ac | ||
|
|
c618dfe519 | ||
|
|
42afbbaaa4 | ||
|
|
730898592e | ||
|
|
0a63027390 | ||
|
|
61aa41abb7 | ||
|
|
66818bb2b6 | ||
|
|
1d180c57e1 | ||
|
|
5119b6ef08 | ||
|
|
14698a4fbf | ||
|
|
bbca7f5660 | ||
|
|
a0c987053d | ||
|
|
61f6558eae | ||
|
|
ba139553af | ||
|
|
15ead88bf2 | ||
|
|
626711d3ac | ||
|
|
51d92f3a6a | ||
|
|
3914fd479a | ||
|
|
a3d0d6916e | ||
|
|
347ad09426 | ||
|
|
744c3e2c5b | ||
|
|
ca11993157 | ||
|
|
132f745176 | ||
|
|
001ea99047 | ||
|
|
74d5f80e4a | ||
|
|
8e600e2290 | ||
|
|
fe6c36df0a | ||
|
|
fe3cd893f7 | ||
|
|
7dfbfce2c4 | ||
|
|
fd66549c35 | ||
|
|
61b183faa3 | ||
|
|
029c168ffb | ||
|
|
2ec8c50752 | ||
|
|
322bc4c9c2 | ||
|
|
8341dc023d | ||
|
|
52ac70bd71 | ||
|
|
3229ba977b | ||
|
|
02c5d6df68 | ||
|
|
10ed451a10 | ||
|
|
31458593f0 | ||
|
|
4a914ca1bf | ||
|
|
66a2165e37 | ||
|
|
035f96e4f8 | ||
|
|
88b0d19f8b | ||
|
|
ca46b25e6a | ||
|
|
6140b9ca09 | ||
|
|
5ed112e660 | ||
|
|
318ddb4924 | ||
|
|
b073713bfa | ||
|
|
4085f52f2c | ||
|
|
71d78c2ceb | ||
|
|
7d25fb2f5e | ||
|
|
6418ad41d2 | ||
|
|
6a8c4a6220 | ||
|
|
97d18f0c32 | ||
|
|
92b8771128 | ||
|
|
4689cde2f6 | ||
|
|
7132ff6bc1 | ||
|
|
e159ffb746 | ||
|
|
882fad8a8e | ||
|
|
6c6008506f | ||
|
|
403346372f | ||
|
|
4ae2b5037d | ||
|
|
a67eb7f224 | ||
|
|
d9619cbfa9 | ||
|
|
c098d0d842 | ||
|
|
b2823262ba | ||
|
|
42d8b111ec | ||
|
|
cfa37dc27d | ||
|
|
2be48ab1fa | ||
|
|
cd6a73c07f | ||
|
|
4264916df5 | ||
|
|
32b1aa404a | ||
|
|
1302702ad5 | ||
|
|
3fb44e93e2 |
No files matched your search
+10
-1
@@ -19,7 +19,16 @@ DIST_SUBDIRS = po libgc eglib mono ikvm-native support data runtime scripts man
|
||||
endif
|
||||
endif
|
||||
|
||||
EXTRA_DIST= nls.m4 po.m4 progtest.m4 mono-uninstalled.pc.in build-mingw32.sh LICENSE mkinstalldirs autogen.sh
|
||||
EXTRA_DIST= \
|
||||
LICENSE \
|
||||
autogen.sh \
|
||||
build-mingw32.sh \
|
||||
mkinstalldirs \
|
||||
mono-uninstalled.pc.in \
|
||||
nls.m4 \
|
||||
po.m4 \
|
||||
progtest.m4 \
|
||||
winconfig.h
|
||||
|
||||
DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
|
||||
|
||||
|
||||
+106
-43
@@ -2,7 +2,7 @@
|
||||
CURDIR="`pwd`"
|
||||
MINGW=i386-mingw32msvc
|
||||
CROSS_DIR=/opt/cross/$MINGW
|
||||
COPY_DLLS="libgio*.dll libglib*.dll libgmodule*.dll libgthread*.dll libgobject*.dll"
|
||||
EXTRA_CROSS_DIR=
|
||||
INSTALL_DESTDIR="$CURDIR/mono-win32"
|
||||
PROFILES="default net_2_0 net_3_5 net_4_0 moonlight"
|
||||
TEMPORARY_PKG_CONFIG_DIR=/tmp/$RANDOM-pkg-config-$RANDOM
|
||||
@@ -17,62 +17,119 @@ function cleanup ()
|
||||
fi
|
||||
}
|
||||
|
||||
function check_pkg_config_dir ()
|
||||
{
|
||||
local DIR="$1"
|
||||
local DIR_PREFIX="$2"
|
||||
|
||||
if [ ! -d "$DIR" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
install -d -m 755 "$TEMPORARY_PKG_CONFIG_DIR"
|
||||
for pc in "$DIR"/*.pc; do
|
||||
if [ -f $pc ]; then
|
||||
pcname="`basename $pc`"
|
||||
sed -e "s;^prefix=.*;prefix=$DIR_PREFIX;g" < $pc > "$TEMPORARY_PKG_CONFIG_DIR"/$pcname
|
||||
fi;
|
||||
done
|
||||
|
||||
if [ -z "$CROSS_PKG_CONFIG_DIR" ]; then
|
||||
CROSS_PKG_CONFIG_DIR="$TEMPORARY_PKG_CONFIG_DIR"
|
||||
fi
|
||||
}
|
||||
|
||||
function show_build_info ()
|
||||
{
|
||||
cat <<EOF
|
||||
Installation prefix: $MONO_PREFIX
|
||||
CPPFLAGS: ${CPPFLAGS:=not set}
|
||||
LDFLAGS: ${LDFLAGS:=not set}
|
||||
MONO_PATH: ${MONO_PATH:=not set}
|
||||
EOF
|
||||
}
|
||||
|
||||
function setup ()
|
||||
{
|
||||
local pcname
|
||||
|
||||
CROSS_BIN_DIR="$CROSS_DIR/bin"
|
||||
CROSS_DLL_DIR="$CROSS_DIR/bin"
|
||||
CROSS_PKG_CONFIG_DIR=$CROSS_DIR/lib/pkgconfig
|
||||
PATH=$CROSS_BIN_DIR:$PATH
|
||||
|
||||
export PATH
|
||||
if [ -d ./.git/svn ]; then
|
||||
SVN_INFO='git svn info'
|
||||
elif [ -d ./.svn ]; then
|
||||
SVN_INFO='svn info'
|
||||
else
|
||||
SVN_INFO=""
|
||||
fi
|
||||
|
||||
if [ -n "$SVN_INFO" ]; then
|
||||
MONO_SVN_REVISION=`$SVN_INFO | grep Revision | sed 's/.*: //'`
|
||||
MONO_BRANCH=`$SVN_INFO | grep URL | sed -e 's;.*source/;;g' -e 's;/mono;;g'`
|
||||
else
|
||||
MONO_SVN_REVISION="rUNKNOWN"
|
||||
MONO_BRANCH="tarball"
|
||||
fi
|
||||
|
||||
MONO_VERSION=`grep AM_INIT_AUTOMAKE configure.in | cut -d ',' -f 2|tr -d '\)'`
|
||||
MONO_RELEASE="$MONO_VERSION-$MONO_BRANCH-r$MONO_SVN_REVISION"
|
||||
MONO_PREFIX="/mono-$MONO_RELEASE"
|
||||
|
||||
if [ -d ./.git ]; then
|
||||
MONO_GIT_COMMIT="`git log -1 --format=format:%t`"
|
||||
MONO_GIT_BRANCH="`git branch|grep '\*'|cut -d ' ' -f 2`"
|
||||
MONO_RELEASE="$MONO_VERSION-$MONO_GIT_BRANCH-$MONO_GIT_COMMIT"
|
||||
else
|
||||
MONO_RELEASE="$MONO_VERSION"
|
||||
fi
|
||||
|
||||
MONO_PREFIX="$MONO_PREFIX/mono-$MONO_RELEASE"
|
||||
|
||||
NOCONFIGURE=yes
|
||||
export NOCONFIGURE
|
||||
|
||||
if [ -d "$CROSS_PKG_CONFIG_DIR" ]; then
|
||||
install -d -m 755 "$TEMPORARY_PKG_CONFIG_DIR"
|
||||
for pc in "$CROSS_PKG_CONFIG_DIR"/*.pc; do
|
||||
pcname="`basename $pc`"
|
||||
sed -e "s;^prefix=.*;prefix=$CROSS_DIR;g" < $pc > "$TEMPORARY_PKG_CONFIG_DIR"/$pcname
|
||||
done
|
||||
CROSS_PKG_CONFIG_DIR="$TEMPORARY_PKG_CONFIG_DIR"
|
||||
fi
|
||||
check_pkg_config_dir "$CROSS_DIR/lib/pkgconfig" "$CROSS_DIR"
|
||||
|
||||
echo Mono Win32 installation prefix: $MONO_PREFIX
|
||||
if [ -n "$EXTRA_CROSS_DIR" -a -d "$EXTRA_CROSS_DIR" ]; then
|
||||
if [ -d "$EXTRA_CROSS_DIR/bin" ]; then
|
||||
PATH="$EXTRA_CROSS_DIR/bin":$PATH
|
||||
fi
|
||||
|
||||
check_pkg_config_dir "$EXTRA_CROSS_DIR/lib/pkgconfig" "$EXTRA_CROSS_DIR"
|
||||
|
||||
if [ -d "$EXTRA_CROSS_DIR/include" ]; then
|
||||
if [ -z "$CPPFLAGS" ]; then
|
||||
CPPFLAGS="-I \"$EXTRA_CROSS_DIR/include\""
|
||||
else
|
||||
CPPFLAGS="-I \"$EXTRA_CROSS_DIR/include\" $CFLAGS"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -d "$EXTRA_CROSS_DIR/lib" ]; then
|
||||
if [ -z "$LDFLAGS" ]; then
|
||||
LDFLAGS="-I \"$EXTRA_CROSS_DIR/lib\""
|
||||
else
|
||||
LDFLAGS="-I \"$EXTRA_CROSS_DIR/lib\" $LDFLAGS"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -d "$EXTRA_CROSS_DIR/share/aclocal" ]; then
|
||||
if [ -z "$MONO_PATH" ]; then
|
||||
MONO_PATH="\"$EXTRA_CROSS_DIR\""
|
||||
else
|
||||
MONO_PATH="\"$EXTRA_CROSS_DIR\":$MONO_PATH"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
export PATH MONO_PATH CPPFLAGS
|
||||
show_build_info
|
||||
}
|
||||
|
||||
function build ()
|
||||
{
|
||||
if [ -f ./Makefile ]; then
|
||||
make distclean
|
||||
fi
|
||||
|
||||
if [ -d ./autom4te.cache ]; then
|
||||
rm -rf ./autom4te.cache
|
||||
fi
|
||||
|
||||
if [ -f ./config.status ]; then
|
||||
for f in `find -name config.status -type f`; do
|
||||
rm $f
|
||||
done
|
||||
fi
|
||||
|
||||
./autogen.sh
|
||||
|
||||
BUILD="`./config.guess`"
|
||||
|
||||
if [ -f ./Makefile ]; then
|
||||
make distclean
|
||||
rm -rf autom4te.cache
|
||||
fi
|
||||
|
||||
if [ ! -d "$CURDIR/build-cross-windows" ]; then
|
||||
mkdir "$CURDIR/build-cross-windows"
|
||||
fi
|
||||
@@ -105,27 +162,28 @@ function doinstall ()
|
||||
cd "$CURDIR/build-cross-windows"
|
||||
make DESTDIR="$INSTALL_DESTDIR" USE_BATCH_FILES=yes install
|
||||
|
||||
cd "$CURDIR/../mcs/mcs"
|
||||
if test -d $CURDIR/mcs; then
|
||||
mcsdir=$CURDIR/mcs
|
||||
else
|
||||
mcsdir=$CURDIR/../mcs
|
||||
fi
|
||||
|
||||
cd "$mcsdir/mcs"
|
||||
for p in $PROFILES; do
|
||||
make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "mcs profile $p installation failed"
|
||||
done
|
||||
|
||||
cd "$CURDIR/../mcs/class"
|
||||
cd "$mcsdir/class"
|
||||
for p in $PROFILES; do
|
||||
make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "class library profile $p installation failed"
|
||||
done
|
||||
|
||||
cd "$CURDIR/../mcs/tools"
|
||||
cd "$mcsdir/tools"
|
||||
for p in $PROFILES; do
|
||||
make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "tools profile $p installation failed"
|
||||
done
|
||||
|
||||
cd "$CURDIR/mono-win32"
|
||||
for dll in $COPY_DLLS; do
|
||||
cp -ap "$CROSS_DLL_DIR"/$dll "$INSTALL_DESTDIR/$MONO_PREFIX/bin"
|
||||
done
|
||||
|
||||
rm -f "$CURDIR/mono-win32-$MONO_RELEASE".zip
|
||||
zip -9r "$CURDIR/mono-win32-$MONO_RELEASE".zip .
|
||||
|
||||
@@ -139,7 +197,9 @@ Usage: build-mingw32.sh [OPTIONS]
|
||||
where OPTIONS are:
|
||||
|
||||
-d DIR Sets the location of directory where MINGW is installed [$CROSS_DIR]
|
||||
-e DIR Sets the location of directory where additional cross develoment packages are installed [${EXTRA_CROSS_DIR:=none}]
|
||||
-m MINGW Sets the MINGW target name to be passed to configure [$MINGW]
|
||||
-p PREFIX Prefix at which Mono is to be installed. Build will append the 'mono-X.Y' string to that path
|
||||
EOF
|
||||
|
||||
exit 1
|
||||
@@ -149,10 +209,12 @@ trap cleanup 0
|
||||
|
||||
pushd . > /dev/null
|
||||
|
||||
while getopts "d:m:h" opt; do
|
||||
while getopts "d:m:e:p:" opt; do
|
||||
case "$opt" in
|
||||
d) CROSS_DIR="$OPTARG" ;;
|
||||
m) MINGW="$OPTARG" ;;
|
||||
e) EXTRA_CROSS_DIR="$OPTARG" ;;
|
||||
p) MONO_PREFIX="$OPTARG" ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
@@ -160,5 +222,6 @@ done
|
||||
setup
|
||||
build
|
||||
doinstall
|
||||
show_build_info
|
||||
|
||||
popd > /dev/null
|
||||
+19
-1
@@ -6,7 +6,7 @@ AC_CANONICAL_SYSTEM
|
||||
m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(mono,2.9)
|
||||
AM_INIT_AUTOMAKE(mono,2.10.1)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
API_VER=2.0
|
||||
@@ -851,6 +851,14 @@ case "x$gc" in
|
||||
if test "x$found_gc_enable" = "xyes"; then
|
||||
BOEHM_DEFINES="-DHAVE_GC_ENABLE $BOEHM_DEFINES"
|
||||
fi
|
||||
|
||||
# check whether we need to explicitly allow
|
||||
# thread registering
|
||||
AC_CHECK_LIB(gc, GC_allow_register_threads, found_allow_register_threads="yes",,$libdl)
|
||||
if test "x$found_allow_register_threads" = "xyes"; then
|
||||
AC_DEFINE(HAVE_GC_ALLOW_REGISTER_THREADS, 1, [GC requires thread registration])
|
||||
fi
|
||||
|
||||
;;
|
||||
|
||||
xincluded)
|
||||
@@ -1746,6 +1754,11 @@ if test x$target_win32 = xno; then
|
||||
dnl * on xp+
|
||||
AC_DEFINE(HAVE_GETPROCESSID, 1, [Define if GetProcessId is available])
|
||||
else
|
||||
dnl *********************************
|
||||
dnl *** Checks for Windows compilation ***
|
||||
dnl *********************************
|
||||
AC_CHECK_HEADERS(winternl.h)
|
||||
|
||||
jdk_headers_found=no
|
||||
AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32", AC_ERROR(bad mingw install?))
|
||||
AC_CHECK_LIB(psapi, main, LIBS="$LIBS -lpsapi", AC_ERROR(bad mingw install?))
|
||||
@@ -2964,6 +2977,11 @@ fi
|
||||
enable_system_aot=yes
|
||||
fi
|
||||
|
||||
if test "x$enable_loadedllvm" = "xyes"; then
|
||||
# This seems to fail on the x86 buildbots
|
||||
enable_system_aot=no
|
||||
fi
|
||||
|
||||
if test x$host_win32 = xno -a x$platform_darwin != xyes -a x$enable_system_aot = xyes; then
|
||||
echo "ENABLE_AOT = 1" >> $mcs_topdir/build/config.make
|
||||
fi
|
||||
|
||||
@@ -288,6 +288,8 @@ def lookup_pretty_printer(val):
|
||||
return ObjectPrinter (val)
|
||||
if t == "string":
|
||||
return StringPrinter (val)
|
||||
if t == "MonoString *":
|
||||
return StringPrinter (val)
|
||||
if t == "MonoMethod *":
|
||||
return MonoMethodPrinter (val)
|
||||
if t == "MonoClass *":
|
||||
|
||||
@@ -84,6 +84,10 @@
|
||||
<section name="serviceHostingEnvironment" type="System.ServiceModel.Configuration.ServiceHostingEnvironmentSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="services" type="System.ServiceModel.Configuration.ServicesSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
</sectionGroup>
|
||||
<sectionGroup name="system.transactions" type="System.Transactions.Configuration.TransactionsSectionGroup, System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null">
|
||||
<section name="defaultSettings" type="System.Transactions.Configuration.DefaultSettingsSection, System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null"/>
|
||||
<section name="machineSettings" type="System.Transactions.Configuration.MachineSettingsSection, System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" allowDefinition="MachineOnly" allowExeDefinition="MachineOnly"/>
|
||||
</sectionGroup>
|
||||
<section name="system.webServer" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="uri" type="System.Configuration.UriSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
</configSections>
|
||||
|
||||
@@ -98,6 +98,10 @@
|
||||
<section name="routing" type="System.ServiceModel.Routing.Configuration.RoutingSection, System.ServiceModel.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<section name="protocolMapping" type="System.ServiceModel.Configuration.ProtocolMappingSection, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
</sectionGroup>
|
||||
<sectionGroup name="system.transactions" type="System.Transactions.Configuration.TransactionsSectionGroup, System.Transactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null">
|
||||
<section name="defaultSettings" type="System.Transactions.Configuration.DefaultSettingsSection, System.Transactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null"/>
|
||||
<section name="machineSettings" type="System.Transactions.Configuration.MachineSettingsSection, System.Transactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" allowDefinition="MachineOnly" allowExeDefinition="MachineOnly"/>
|
||||
</sectionGroup>
|
||||
<section name="system.webServer" type="System.Configuration.IgnoreSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="uri" type="System.Configuration.UriSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<sectionGroup name="system.runtime.caching" type="System.Runtime.Caching.Configuration.CachingSectionGroup, System.Runtime.Caching, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
|
||||
+28
-11
@@ -46,17 +46,20 @@ case $host in
|
||||
PATHSEP='\\'
|
||||
SEARCHSEP=';'
|
||||
OS="WIN32"
|
||||
PIDTYPE='void *'
|
||||
;;
|
||||
*-*darwin*)
|
||||
platform_darwin=yes
|
||||
PATHSEP='/'
|
||||
SEARCHSEP=':'
|
||||
OS="UNIX"
|
||||
PIDTYPE='int'
|
||||
;;
|
||||
*)
|
||||
PATHSEP='/'
|
||||
SEARCHSEP=':'
|
||||
OS="UNIX"
|
||||
PIDTYPE='int'
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -84,12 +87,15 @@ AC_SUBST(CFLAGS)
|
||||
AC_SUBST(PATHSEP)
|
||||
AC_SUBST(SEARCHSEP)
|
||||
AC_SUBST(OS)
|
||||
AC_SUBST(PIDTYPE)
|
||||
AM_CONDITIONAL(HOST_WIN32, test x$OS = xWIN32)
|
||||
AM_CONDITIONAL(TARGET_WIN32, test x$OS = xWIN32)
|
||||
AM_CONDITIONAL(PLATFORM_DARWIN, test x$platform_darwin = xyes)
|
||||
|
||||
AC_CHECK_SIZEOF(int)
|
||||
AC_CHECK_SIZEOF(void *)
|
||||
AC_CHECK_SIZEOF(long)
|
||||
AC_CHECK_SIZEOF(long long)
|
||||
AC_CHECK_FUNCS(strndup strlcpy getpwuid_r strtok_r rewinddir vasprintf)
|
||||
AM_CONDITIONAL(NEED_VASPRINTF, test x$have_vasprintf = x )
|
||||
AC_CHECK_LIB(iconv, iconv_open, LIBS="$LIBS -liconv")
|
||||
@@ -126,20 +132,11 @@ if test "x$have_iso_varargs" = "xyes"; then
|
||||
fi
|
||||
AC_SUBST(G_HAVE_ISO_VARARGS)
|
||||
|
||||
AC_CHECK_HEADERS(getopt.h sys/time.h sys/wait.h pwd.h langinfo.h iconv.h localcharset.h)
|
||||
AC_CHECK_HEADERS(getopt.h sys/time.h sys/wait.h pwd.h langinfo.h iconv.h localcharset.h sys/types.h)
|
||||
AC_CHECK_HEADER(alloca.h, [HAVE_ALLOCA_H=1], [HAVE_ALLOCA_H=0])
|
||||
AC_SUBST(HAVE_ALLOCA_H)
|
||||
|
||||
if test $ac_cv_sizeof_void_p != $ac_cv_sizeof_int; then
|
||||
GPOINTER_TO_INT="((gint)(long) (ptr))"
|
||||
GPOINTER_TO_UINT="((guint)(long) (ptr))"
|
||||
GINT_TO_POINTER="((gpointer)(glong) (v))"
|
||||
GUINT_TO_POINTER="((gpointer)(gulong) (v))"
|
||||
GSIZE="long"
|
||||
GSIZE_FORMAT='"lu"'
|
||||
G_GUINT64_FORMAT='"lu"'
|
||||
G_GINT64_FORMAT='"ld"'
|
||||
else
|
||||
if test $ac_cv_sizeof_void_p = $ac_cv_sizeof_int; then
|
||||
GPOINTER_TO_INT="((gint) (ptr))"
|
||||
GPOINTER_TO_UINT="((guint) (ptr))"
|
||||
GINT_TO_POINTER="((gpointer) (v))"
|
||||
@@ -148,6 +145,26 @@ else
|
||||
GSIZE_FORMAT='"u"'
|
||||
G_GUINT64_FORMAT='"llu"'
|
||||
G_GINT64_FORMAT='"lld"'
|
||||
elif test $ac_cv_sizeof_void_p = $ac_cv_sizeof_long; then
|
||||
GPOINTER_TO_INT="((gint)(long) (ptr))"
|
||||
GPOINTER_TO_UINT="((guint)(long) (ptr))"
|
||||
GINT_TO_POINTER="((gpointer)(glong) (v))"
|
||||
GUINT_TO_POINTER="((gpointer)(gulong) (v))"
|
||||
GSIZE="long"
|
||||
GSIZE_FORMAT='"lu"'
|
||||
G_GUINT64_FORMAT='"lu"'
|
||||
G_GINT64_FORMAT='"ld"'
|
||||
elif test $ac_cv_sizeof_void_p = $ac_cv_sizeof_long_long; then
|
||||
GPOINTER_TO_INT="((gint)(long long) (ptr))"
|
||||
GPOINTER_TO_UINT="((guint)(unsigned long long) (ptr))"
|
||||
GINT_TO_POINTER="((gpointer)(long long) (v))"
|
||||
GUINT_TO_POINTER="((gpointer)(unsigned long long) (v))"
|
||||
GSIZE="long long"
|
||||
GSIZE_FORMAT='"I64u"'
|
||||
G_GUINT64_FORMAT='"I64u"'
|
||||
G_GINT64_FORMAT='"I64i"'
|
||||
else
|
||||
AC_MSG_ERROR([unsupported pointer size])
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
|
||||
@@ -24,7 +24,6 @@ os_files = $(unix_files)
|
||||
endif
|
||||
|
||||
libeglib_la_SOURCES = \
|
||||
eglib-config.h \
|
||||
eglib-remap.h \
|
||||
sort.frag.h \
|
||||
glib.h \
|
||||
|
||||
@@ -42,4 +42,6 @@ typedef signed @GSIZE@ gssize;
|
||||
#define G_BREAKPOINT()
|
||||
#endif
|
||||
|
||||
typedef @PIDTYPE@ GPid;
|
||||
|
||||
#endif
|
||||
@@ -71,4 +71,6 @@ int vasprintf(char **ret, const char *fmt, va_list ap);
|
||||
#pragma warning(disable:4100 4127)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
typedef void * GPid;
|
||||
|
||||
#endif
|
||||
@@ -33,6 +33,9 @@
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <direct.h>
|
||||
|
||||
@@ -579,13 +579,13 @@ g_direct_hash (gconstpointer v1)
|
||||
gboolean
|
||||
g_int_equal (gconstpointer v1, gconstpointer v2)
|
||||
{
|
||||
return GPOINTER_TO_INT (v1) == GPOINTER_TO_INT (v2);
|
||||
return *(gint *)v1 == *(gint *)v2;
|
||||
}
|
||||
|
||||
guint
|
||||
g_int_hash (gconstpointer v1)
|
||||
{
|
||||
return GPOINTER_TO_UINT(v1);
|
||||
return *(guint *)v1;
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
#pragma include_alias(<eglib-config.h>, <eglib-config.hw>)
|
||||
#else
|
||||
#include <stdint.h>
|
||||
/* For pid_t */
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <eglib-config.h>
|
||||
@@ -716,8 +712,6 @@ typedef enum {
|
||||
G_SPAWN_FILE_AND_ARGV_ZERO = 1 << 6
|
||||
} GSpawnFlags;
|
||||
|
||||
typedef pid_t GPid;
|
||||
|
||||
typedef void (*GSpawnChildSetupFunc) (gpointer user_data);
|
||||
|
||||
gboolean g_spawn_command_line_sync (const gchar *command_line, gchar **standard_output, gchar **standard_error, gint *exit_status, GError **error);
|
||||
|
||||
@@ -9,7 +9,7 @@ int vasprintf(char **ret, const char *fmt, va_list ap)
|
||||
size_t buflen;
|
||||
va_list ap2;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR)
|
||||
ap2 = ap;
|
||||
len = _vscprintf(fmt, ap2); // NOTE MS specific extension ( :-( )
|
||||
#else
|
||||
|
||||
+19
-1
@@ -6,7 +6,7 @@
|
||||
.SH NAME
|
||||
csharp, gsharp \- Interactive C# Shell
|
||||
.SH SYNOPSIS
|
||||
.B csharp [--attach PID] [file1 [file2]]
|
||||
.B csharp [--attach PID] [-e EXPRESSION] [file1 [file2]]
|
||||
[options]
|
||||
.P
|
||||
.B gsharp [file1 [file2]]
|
||||
@@ -29,7 +29,22 @@ target process.
|
||||
.PP
|
||||
Files specified in the command line will be loaded and executed as
|
||||
scripts.
|
||||
.PP
|
||||
Starting with Mono 2.10, the
|
||||
.I csharp
|
||||
command can be used as an interpreter executed by executables flagged
|
||||
with the Unix execute attribute. To do this, make the first line of
|
||||
your C# source code look like this:
|
||||
.nf
|
||||
"#!/usr/bin/csharp"
|
||||
Console.WriteLine ("Hello, World");
|
||||
.fi
|
||||
.SH OPTIONS
|
||||
The commands accept all of the commands that are available to the
|
||||
.I mcs
|
||||
command, so you can reference assemblies, specify paths, language
|
||||
level and so on from the command line. In addition, the following
|
||||
command line options are supported:
|
||||
.TP
|
||||
.I "\-\-attach"
|
||||
This is an advanced option and should only be used if you have a deep
|
||||
@@ -42,6 +57,9 @@ special measures to avoid crashing the target application while using
|
||||
it. For example, you might have to take the proper locks before
|
||||
issuing any commands that might affect the target process state, or
|
||||
sending commands through a method dispatcher.
|
||||
.TP
|
||||
.I "\-e" EXPRESSION
|
||||
This will evaluate the specified C# EXPRESSION and exit
|
||||
.SH OPERATION
|
||||
Once you launch the csharp command, you will be greeted with the
|
||||
interactive prompt:
|
||||
|
||||
@@ -351,6 +351,11 @@ shell will perform globbing, so you might want to use it like this:
|
||||
$ mcs -recurse:'*.cs'
|
||||
.fi
|
||||
.TP
|
||||
.I \-sdk:VERSION
|
||||
Used to specify the version of Base Class Library assemblies. The possible
|
||||
values are: 2 (default), 4. The version number means which .NET version
|
||||
should the produced assembly be compatible with.
|
||||
.TP
|
||||
.I \-\-shell
|
||||
Starts up the compiler in interactive mode, providing a C# shell for
|
||||
statements and expressions. A shortcut is to use the
|
||||
|
||||
+10
@@ -1021,6 +1021,16 @@ Enables or disables concurrent sweep for the Mark&Sweep collector. If
|
||||
enabled, the sweep phase of the garbage collection is done in a thread
|
||||
concurrently with the application. Concurrent sweep is disabled by
|
||||
default.
|
||||
.TP
|
||||
\fBstack-mark=\fImark-mode\fR
|
||||
Specifies how application threads should be scanned. Options are
|
||||
`precise` and `conservative`. Precise marking allow the collector
|
||||
to know what values on stack are references and what are not.
|
||||
Conservative marking threats all values as potentially references
|
||||
and leave them untouched. Precise marking reduces floating garbage
|
||||
and can speed up nursery collection and allocation rate, it has
|
||||
the downside of requiring a significant extra memory per compiled
|
||||
method. The right option, unfortunately, requires experimentation.
|
||||
.ne
|
||||
.RE
|
||||
.TP
|
||||
|
||||
+7
-2
@@ -74,8 +74,9 @@ to $prefix/lib/mono/xbuild . When used in Import, like:
|
||||
xbuild tries various values for the msbuild property $(MSBuildExtensionsPath), in order:
|
||||
|
||||
1. Paths specified in the environment variable $MSBuildExtensionsPath.
|
||||
2. $XDG_CONFIG_HOME/xbuild/tasks (or Environment.SpecialFolder.ApplicationData)
|
||||
3. $prefix/lib/mono/xbuild (default location)
|
||||
2. /Library/Frameworks/Mono.framework/External/xbuild on Mac OSX.
|
||||
3. $XDG_CONFIG_HOME/xbuild/tasks (or Environment.SpecialFolder.ApplicationData)
|
||||
4. $prefix/lib/mono/xbuild (default location)
|
||||
|
||||
Anywhere else in the project files, $(MSBuildExtensionsPath) will always resolve to the default
|
||||
location. This is a xbuild-only feature.
|
||||
@@ -111,6 +112,10 @@ For example, you could set this variable from your shell:
|
||||
You can disable the built-in color scheme by setting this variable to
|
||||
"disable".
|
||||
|
||||
.SH NOTES
|
||||
On Mac OSX, for locating pkg-config (.pc) files, xbuild additionally
|
||||
looks in "/Library/Frameworks/Mono.framework/External/pkgconfig" .
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR mono(1), mcs(1)
|
||||
.SH COPYRIGHT
|
||||
|
||||
@@ -166,33 +166,21 @@ namespace IKVM.Reflection.Emit
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if (x.tryOffset >= y.handlerOffset && x.tryOffset + x.tryLength <= y.handlerOffset + y.handlerLength)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (y.tryOffset >= x.handlerOffset && y.tryOffset + y.tryLength <= x.handlerOffset + x.handlerLength)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if (x.tryOffset == y.tryOffset && x.tryLength == y.tryLength)
|
||||
else if (x.tryOffset == y.tryOffset && x.tryLength == y.tryLength)
|
||||
{
|
||||
return x.ordinal < y.ordinal ? -1 : 1;
|
||||
}
|
||||
if (x.tryOffset + x.tryLength <= y.tryOffset)
|
||||
else if (x.tryOffset >= y.tryOffset && x.handlerOffset + x.handlerLength <= y.handlerOffset + y.handlerLength)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (y.tryOffset + y.tryLength <= x.tryOffset)
|
||||
else if (y.tryOffset >= x.tryOffset && y.handlerOffset + y.handlerLength <= x.handlerOffset + x.handlerLength)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if (x.tryOffset > y.tryOffset || (x.tryOffset == y.tryOffset && x.tryLength < y.tryLength))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
return x.ordinal < y.ordinal ? -1 : 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
Copyright (C) 2010 Jeroen Frijters
|
||||
Copyright (C) 2011 Marek Safar
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
@@ -57,7 +58,8 @@ namespace IKVM.Reflection
|
||||
[DllImport("fusion", CharSet = CharSet.Unicode)]
|
||||
private static extern int CompareAssemblyIdentity(string pwzAssemblyIdentity1, bool fUnified1, string pwzAssemblyIdentity2, bool fUnified2, out bool pfEquivalent, out AssemblyComparisonResult pResult);
|
||||
|
||||
private static bool CompareAssemblyIdentityPure(string assemblyIdentity1, bool unified1, string assemblyIdentity2, bool unified2, out AssemblyComparisonResult result)
|
||||
// internal for use by mcs
|
||||
internal static bool CompareAssemblyIdentityPure(string assemblyIdentity1, bool unified1, string assemblyIdentity2, bool unified2, out AssemblyComparisonResult result)
|
||||
{
|
||||
ParsedAssemblyName name1;
|
||||
ParsedAssemblyName name2;
|
||||
@@ -109,6 +111,11 @@ namespace IKVM.Reflection
|
||||
result = AssemblyComparisonResult.EquivalentPartialMatch;
|
||||
return true;
|
||||
}
|
||||
else if (IsFrameworkAssembly(name2))
|
||||
{
|
||||
result = partial ? AssemblyComparisonResult.EquivalentPartialFXUnified : AssemblyComparisonResult.EquivalentFXUnified;
|
||||
return true;
|
||||
}
|
||||
else if (name1.Version < name2.Version)
|
||||
{
|
||||
if (unified2)
|
||||
@@ -141,6 +148,11 @@ namespace IKVM.Reflection
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (IsStrongNamed(name1))
|
||||
{
|
||||
result = AssemblyComparisonResult.NonEquivalent;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = partial ? AssemblyComparisonResult.EquivalentPartialWeakNamed : AssemblyComparisonResult.EquivalentWeakNamed;
|
||||
@@ -148,6 +160,62 @@ namespace IKVM.Reflection
|
||||
}
|
||||
}
|
||||
|
||||
static bool IsFrameworkAssembly(ParsedAssemblyName name)
|
||||
{
|
||||
// A list of FX assemblies which require some form of remapping
|
||||
// When 4.0 + 1 version is release, assemblies introduced in v4.0
|
||||
// will have to be added
|
||||
switch (name.Name)
|
||||
{
|
||||
case "System":
|
||||
case "System.Core":
|
||||
case "System.Data":
|
||||
case "System.Data.DataSetExtensions":
|
||||
case "System.Data.Linq":
|
||||
case "System.Data.OracleClient":
|
||||
case "System.Data.Services":
|
||||
case "System.Data.Services.Client":
|
||||
case "System.IdentityModel":
|
||||
case "System.IdentityModel.Selectors":
|
||||
case "System.Runtime.Remoting":
|
||||
case "System.Runtime.Serialization":
|
||||
case "System.ServiceModel":
|
||||
case "System.Transactions":
|
||||
case "System.Windows.Forms":
|
||||
case "System.Xml":
|
||||
case "System.Xml.Linq":
|
||||
return name.PublicKeyToken == "b77a5c561934e089";
|
||||
|
||||
case "System.Configuration":
|
||||
case "System.Configuration.Install":
|
||||
case "System.Design":
|
||||
case "System.DirectoryServices":
|
||||
case "System.Drawing":
|
||||
case "System.Drawing.Design":
|
||||
case "System.EnterpriseServices":
|
||||
case "System.Management":
|
||||
case "System.Messaging":
|
||||
case "System.Runtime.Serialization.Formatters.Soap":
|
||||
case "System.Security":
|
||||
case "System.ServiceProcess":
|
||||
case "System.Web":
|
||||
case "System.Web.Mobile":
|
||||
case "System.Web.Services":
|
||||
return name.PublicKeyToken == "b03f5f7f11d50a3a";
|
||||
|
||||
case "System.ComponentModel.DataAnnotations":
|
||||
case "System.ServiceModel.Web":
|
||||
case "System.Web.Abstractions":
|
||||
case "System.Web.Extensions":
|
||||
case "System.Web.Extensions.Design":
|
||||
case "System.Web.DynamicData":
|
||||
case "System.Web.Routing":
|
||||
return name.PublicKeyToken == "31bf3856ad364e35";
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// note that this is the fusion specific parser, it is not the same as System.Reflection.AssemblyName
|
||||
private static bool ParseAssemblyName(string fullName, out ParsedAssemblyName parsedName)
|
||||
{
|
||||
|
||||
@@ -167,11 +167,7 @@ namespace IKVM.Reflection.Reader
|
||||
|
||||
internal float ReadSingle()
|
||||
{
|
||||
if (end - pos < 4)
|
||||
throw new BadImageFormatException();
|
||||
float value = BitConverter.ToSingle(buffer, pos);
|
||||
pos += 4;
|
||||
return value;
|
||||
return SingleConverter.Int32BitsToSingle(ReadInt32());
|
||||
}
|
||||
|
||||
internal double ReadDouble()
|
||||
|
||||
@@ -741,7 +741,7 @@ namespace IKVM.Reflection
|
||||
return GetNestedType(name, BindingFlags.Public);
|
||||
}
|
||||
|
||||
public Type GetNestedType(string name, BindingFlags bindingAttr)
|
||||
public virtual Type GetNestedType(string name, BindingFlags bindingAttr)
|
||||
{
|
||||
foreach (Type type in GetNestedTypes(bindingAttr))
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2008-2010 Jeroen Frijters
|
||||
Copyright (C) 2008-2011 Jeroen Frijters
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
@@ -265,4 +265,27 @@ namespace IKVM.Reflection
|
||||
return h;
|
||||
}
|
||||
}
|
||||
|
||||
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Explicit)]
|
||||
struct SingleConverter
|
||||
{
|
||||
[System.Runtime.InteropServices.FieldOffset(0)]
|
||||
private int i;
|
||||
[System.Runtime.InteropServices.FieldOffset(0)]
|
||||
private float f;
|
||||
|
||||
internal static int SingleToInt32Bits(float v)
|
||||
{
|
||||
SingleConverter c = new SingleConverter();
|
||||
c.f = v;
|
||||
return c.i;
|
||||
}
|
||||
|
||||
internal static float Int32BitsToSingle(int v)
|
||||
{
|
||||
SingleConverter c = new SingleConverter();
|
||||
c.i = v;
|
||||
return c.f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -153,18 +153,7 @@ namespace IKVM.Reflection.Writer
|
||||
|
||||
internal void Write(float value)
|
||||
{
|
||||
byte[] s = BitConverter.GetBytes(value);
|
||||
if (BitConverter.IsLittleEndian) {
|
||||
Write(s);
|
||||
} else {
|
||||
if (pos + 4 > buffer.Length)
|
||||
Grow(4);
|
||||
|
||||
buffer[pos++] = s [3];
|
||||
buffer[pos++] = s [2];
|
||||
buffer[pos++] = s [1];
|
||||
buffer[pos++] = s [0];
|
||||
}
|
||||
Write(SingleConverter.SingleToInt32Bits(value));
|
||||
}
|
||||
|
||||
internal void Write(double value)
|
||||
|
||||
+9
-5
@@ -102,15 +102,15 @@ net_2_0_dirs := \
|
||||
Mono.Tasklets \
|
||||
Mono.CSharp \
|
||||
Moonlight.Build.Tasks \
|
||||
WindowsBase \
|
||||
System.Data.Services \
|
||||
System.Data.Services.Client \
|
||||
System.Data.Services \
|
||||
System.Net
|
||||
|
||||
net_2_0_only_dirs := \
|
||||
System.Web.Extensions_1.0 \
|
||||
System.Web.Extensions.Design_1.0 \
|
||||
Compat.ICSharpCode.SharpZipLib
|
||||
Compat.ICSharpCode.SharpZipLib \
|
||||
WindowsBase \
|
||||
System.Data.Services.Client
|
||||
|
||||
moonlight_dirs := \
|
||||
corlib \
|
||||
@@ -159,11 +159,15 @@ net_4_0_dirs := \
|
||||
System.Windows.Forms.DataVisualization \
|
||||
System.ComponentModel.Composition \
|
||||
System.Xaml \
|
||||
WindowsBase \
|
||||
System.Data.Services.Client \
|
||||
System.ServiceModel.Routing \
|
||||
System.ServiceModel.Discovery \
|
||||
System.Runtime.Caching \
|
||||
System.Runtime.DurableInstancing \
|
||||
Mono.CodeContracts
|
||||
Mono.CodeContracts \
|
||||
Microsoft.Web.Infrastructure \
|
||||
WebMatrix.Data
|
||||
|
||||
net_2_0_SUBDIRS := $(common_dirs) $(net_2_0_dirs) $(net_2_0_only_dirs)
|
||||
moonlight_raw_SUBDIRS := $(moonlight_dirs)
|
||||
|
||||
+1
-1
@@ -148,7 +148,7 @@ namespace System.Windows.Forms.CarbonInternal {
|
||||
Control c = Control.FromHandle (hwnd.client_window);
|
||||
if (c != null) {
|
||||
Form form = c.FindForm ();
|
||||
if (form != null) {
|
||||
if (form != null && XplatUICarbon.UnactiveWindow != form.Handle) {
|
||||
Driver.SendMessage (form.Handle, Msg.WM_ACTIVATE, (IntPtr) WindowActiveFlags.WA_INACTIVE, IntPtr.Zero);
|
||||
XplatUICarbon.ActiveWindow = IntPtr.Zero;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ using System.ComponentModel.Design.Serialization;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace System.Windows.Forms {
|
||||
[DesignerCategory("Form")]
|
||||
@@ -1792,13 +1793,13 @@ namespace System.Windows.Forms {
|
||||
XplatUI.UngrabWindow(capture_window);
|
||||
}
|
||||
|
||||
var disable = new List<Form> ();
|
||||
foreach (Form form in Application.OpenForms)
|
||||
{
|
||||
if (form.Enabled == true)
|
||||
{
|
||||
disabled_by_showdialog.Add(form);
|
||||
form.Enabled = false;
|
||||
}
|
||||
if (form.Enabled)
|
||||
disable.Add (form);
|
||||
foreach (Form form in disable){
|
||||
disabled_by_showdialog.Add (form);
|
||||
form.Enabled = false;
|
||||
}
|
||||
modal_dialogs.Add(this);
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ namespace System.Windows.Forms {
|
||||
// Internal members available to the event handler sub-system
|
||||
internal static IntPtr FocusWindow;
|
||||
internal static IntPtr ActiveWindow;
|
||||
internal static IntPtr UnactiveWindow;
|
||||
internal static IntPtr ReverseWindow;
|
||||
internal static IntPtr CaretWindow;
|
||||
|
||||
@@ -785,6 +786,7 @@ namespace System.Windows.Forms {
|
||||
|
||||
internal override void Activate(IntPtr handle) {
|
||||
if (ActiveWindow != IntPtr.Zero) {
|
||||
UnactiveWindow = ActiveWindow;
|
||||
ActivateWindow (HIViewGetWindow (ActiveWindow), false);
|
||||
}
|
||||
ActivateWindow (HIViewGetWindow (handle), true);
|
||||
|
||||
@@ -36,13 +36,20 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
BuildWhen otherwise;
|
||||
Project project;
|
||||
ImportedProject importedProject;
|
||||
XmlElement xmlElement;
|
||||
List <BuildWhen> whens;
|
||||
|
||||
public BuildChoose (XmlElement xmlElement, Project project)
|
||||
: this (xmlElement, project, null)
|
||||
{
|
||||
}
|
||||
|
||||
internal BuildChoose (XmlElement xmlElement, Project project, ImportedProject importedProject)
|
||||
{
|
||||
this.xmlElement = xmlElement;
|
||||
this.project = project;
|
||||
this.importedProject = importedProject;
|
||||
this.whens = new List <BuildWhen> ();
|
||||
|
||||
foreach (XmlNode xn in xmlElement.ChildNodes) {
|
||||
@@ -65,6 +72,9 @@ namespace Microsoft.Build.BuildEngine {
|
||||
otherwise = new BuildWhen (xe, project);
|
||||
}
|
||||
}
|
||||
|
||||
DefinedInFileName = importedProject != null ? importedProject.FullFileName :
|
||||
project != null ? project.FullFileName : null;
|
||||
}
|
||||
|
||||
public void Evaluate ()
|
||||
@@ -85,6 +95,8 @@ namespace Microsoft.Build.BuildEngine {
|
||||
get { return whens; }
|
||||
set { whens = value; }
|
||||
}
|
||||
|
||||
internal string DefinedInFileName { get; private set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
this.name = itemName;
|
||||
this.finalItemSpec = taskItem.ItemSpec;
|
||||
this.itemInclude = Utilities.Escape (taskItem.ItemSpec);
|
||||
this.itemInclude = MSBuildUtils.Escape (taskItem.ItemSpec);
|
||||
this.evaluatedMetadata = (Hashtable) taskItem.CloneCustomMetadata ();
|
||||
this.unevaluatedMetadata = (Hashtable) taskItem.CloneCustomMetadata ();
|
||||
}
|
||||
@@ -127,7 +127,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
{
|
||||
if (ReservedNameUtils.IsReservedMetadataName (metadataName)) {
|
||||
string metadata = ReservedNameUtils.GetReservedMetadata (FinalItemSpec, metadataName, evaluatedMetadata);
|
||||
return (metadataName.ToLower () == "fullpath") ? Utilities.Escape (metadata) : metadata;
|
||||
return (metadataName.ToLower () == "fullpath") ? MSBuildUtils.Escape (metadata) : metadata;
|
||||
}
|
||||
|
||||
if (evaluatedMetadata.Contains (metadataName))
|
||||
@@ -140,7 +140,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
{
|
||||
if (ReservedNameUtils.IsReservedMetadataName (metadataName)) {
|
||||
string metadata = ReservedNameUtils.GetReservedMetadata (FinalItemSpec, metadataName, unevaluatedMetadata);
|
||||
return (metadataName.ToLower () == "fullpath") ? Utilities.Escape (metadata) : metadata;
|
||||
return (metadataName.ToLower () == "fullpath") ? MSBuildUtils.Escape (metadata) : metadata;
|
||||
} else if (unevaluatedMetadata.Contains (metadataName))
|
||||
return (string) unevaluatedMetadata [metadataName];
|
||||
else
|
||||
@@ -199,7 +199,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
metadataName));
|
||||
|
||||
if (treatMetadataValueAsLiteral && !HasParentItem)
|
||||
metadataValue = Utilities.Escape (metadataValue);
|
||||
metadataValue = MSBuildUtils.Escape (metadataValue);
|
||||
|
||||
if (FromXml) {
|
||||
XmlElement element = itemElement [metadataName];
|
||||
@@ -231,7 +231,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
evaluatedMetadata [name] = (string) e.ConvertTo (parent_item_group.ParentProject,
|
||||
typeof (string), ExpressionOptions.ExpandItemRefs);
|
||||
} else
|
||||
evaluatedMetadata [name] = Utilities.Unescape (value);
|
||||
evaluatedMetadata [name] = MSBuildUtils.Unescape (value);
|
||||
|
||||
unevaluatedMetadata [name] = value;
|
||||
}
|
||||
@@ -247,9 +247,9 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
internal void Evaluate (Project project, bool evaluatedTo)
|
||||
{
|
||||
// FIXME: maybe make Expression.ConvertTo (null, ...) work as Utilities.Unescape ()?
|
||||
// FIXME: maybe make Expression.ConvertTo (null, ...) work as MSBuildUtils.Unescape ()?
|
||||
if (project == null) {
|
||||
this.finalItemSpec = Utilities.Unescape (Include);
|
||||
this.finalItemSpec = MSBuildUtils.Unescape (Include);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,9 @@ namespace Microsoft.Build.BuildEngine {
|
||||
buildItems.Add (bi);
|
||||
project.LastItemGroupContaining [bi.Name] = this;
|
||||
}
|
||||
|
||||
DefinedInFileName = importedProject != null ? importedProject.FullFileName :
|
||||
project != null ? project.FullFileName : null;
|
||||
}
|
||||
|
||||
public BuildItem AddNewItem (string itemName,
|
||||
@@ -303,6 +306,8 @@ namespace Microsoft.Build.BuildEngine {
|
||||
}
|
||||
}
|
||||
|
||||
internal string DefinedInFileName { get; private set; }
|
||||
|
||||
internal bool FromXml {
|
||||
get {
|
||||
return itemGroupElement != null;
|
||||
|
||||
@@ -35,6 +35,7 @@ using System.Xml;
|
||||
|
||||
using Microsoft.Build.Framework;
|
||||
using Microsoft.Build.Utilities;
|
||||
using Mono.XBuild.Utilities;
|
||||
|
||||
namespace Microsoft.Build.BuildEngine {
|
||||
public class BuildProperty {
|
||||
@@ -80,7 +81,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
this.propertyType = PropertyType.Normal;
|
||||
this.parentProject = parentProject;
|
||||
this.name = propertyElement.Name;
|
||||
this.value = Utilities.UnescapeFromXml (propertyElement.InnerXml);
|
||||
this.value = MSBuildUtils.UnescapeFromXml (propertyElement.InnerXml);
|
||||
this.isImported = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,6 +71,9 @@ namespace Microsoft.Build.BuildEngine {
|
||||
}
|
||||
} else
|
||||
this.propertiesByName = new Dictionary <string, BuildProperty> (StringComparer.InvariantCultureIgnoreCase);
|
||||
|
||||
DefinedInFileName = importedProject != null ? importedProject.FullFileName :
|
||||
(project != null ? project.FullFileName : null);
|
||||
}
|
||||
|
||||
public BuildProperty AddNewProperty (string propertyName,
|
||||
@@ -287,7 +290,9 @@ namespace Microsoft.Build.BuildEngine {
|
||||
propertiesByName [propertyName] = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal string DefinedInFileName { get; private set; }
|
||||
|
||||
internal GroupingCollection GroupingCollection {
|
||||
get { return parentCollection; }
|
||||
set { parentCollection = value; }
|
||||
|
||||
+3
-1
@@ -72,7 +72,9 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
public override bool CanEvaluateToBool (Project context)
|
||||
{
|
||||
return left.CanEvaluateToBool (context) && right.CanEvaluateToBool (context);
|
||||
// Short-circuiting, check only left expr, right
|
||||
// would be required only if left == true
|
||||
return left.CanEvaluateToBool (context);
|
||||
}
|
||||
|
||||
public override bool CanEvaluateToNumber (Project context)
|
||||
|
||||
+3
-1
@@ -77,7 +77,9 @@ namespace Microsoft.Build.BuildEngine {
|
||||
else if (falseValues [evaluatedToken.Value] != null)
|
||||
return false;
|
||||
else
|
||||
throw new InvalidProjectFileException ();
|
||||
throw new ExpressionEvaluationException (
|
||||
String.Format ("Expression \"{0}\" evaluated to \"{1}\" instead of a boolean value",
|
||||
token.Value, evaluatedToken.Value));
|
||||
}
|
||||
|
||||
public override float NumberEvaluate (Project context)
|
||||
|
||||
@@ -53,12 +53,22 @@ namespace Microsoft.Build.BuildEngine {
|
||||
if (String.IsNullOrEmpty (condition))
|
||||
return true;
|
||||
|
||||
ConditionExpression ce = ParseCondition (condition);
|
||||
try {
|
||||
ConditionExpression ce = ParseCondition (condition);
|
||||
|
||||
if (!ce.CanEvaluateToBool (context))
|
||||
throw new InvalidProjectFileException (String.Format ("Can not evaluate \"{0}\" to bool.", condition));
|
||||
if (!ce.CanEvaluateToBool (context))
|
||||
throw new InvalidProjectFileException (String.Format ("Can not evaluate \"{0}\" to bool.", condition));
|
||||
|
||||
return ce.BoolEvaluate (context);
|
||||
return ce.BoolEvaluate (context);
|
||||
} catch (ExpressionParseException epe) {
|
||||
throw new InvalidProjectFileException (
|
||||
String.Format ("Unable to parse condition \"{0}\" : {1}", condition, epe.Message),
|
||||
epe);
|
||||
} catch (ExpressionEvaluationException epe) {
|
||||
throw new InvalidProjectFileException (
|
||||
String.Format ("Unable to evaluate condition \"{0}\" : {1}", condition, epe.Message),
|
||||
epe);
|
||||
}
|
||||
}
|
||||
|
||||
public static ConditionExpression ParseCondition (string condition)
|
||||
|
||||
@@ -456,9 +456,11 @@ namespace Microsoft.Build.BuildEngine {
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
for (int i = 0; i < indent; i++)
|
||||
sb.Append ('\t');
|
||||
sb.Append (message);
|
||||
|
||||
writeHandler (sb.ToString ());
|
||||
string indent_str = sb.ToString ();
|
||||
|
||||
foreach (string line in message.Split (new string[] {Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries))
|
||||
writeHandler (indent_str + line);
|
||||
} else {
|
||||
writeHandler (message);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Microsoft.Build.Framework;
|
||||
using Microsoft.Build.Utilities;
|
||||
using Mono.XBuild.Utilities;
|
||||
@@ -308,8 +309,10 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
internal void RemoveLoadedProject (Project p)
|
||||
{
|
||||
if (p.FullFileName != String.Empty)
|
||||
if (!String.IsNullOrEmpty (p.FullFileName)) {
|
||||
ClearBuiltTargetsForProject (p);
|
||||
projects.Remove (p.FullFileName);
|
||||
}
|
||||
}
|
||||
|
||||
internal void AddLoadedProject (Project p)
|
||||
@@ -328,8 +331,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
project.CheckUnloaded ();
|
||||
|
||||
if (project.FullFileName != String.Empty)
|
||||
projects.Remove (project.FullFileName);
|
||||
RemoveLoadedProject (project);
|
||||
|
||||
project.Unload ();
|
||||
}
|
||||
@@ -401,6 +403,14 @@ namespace Microsoft.Build.BuildEngine {
|
||||
}
|
||||
}
|
||||
|
||||
internal void ClearBuiltTargetsForProject (Project project)
|
||||
{
|
||||
string project_key = project.GetKeyForTarget (String.Empty, false);
|
||||
var to_remove_keys = BuiltTargetsOutputByName.Keys.Where (key => key.StartsWith (project_key)).ToList ();
|
||||
foreach (string to_remove_key in to_remove_keys)
|
||||
BuiltTargetsOutputByName.Remove (to_remove_key);
|
||||
}
|
||||
|
||||
void LogProjectStarted (Project project, string [] target_names)
|
||||
{
|
||||
string targets;
|
||||
|
||||
@@ -33,6 +33,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Mono.XBuild.Utilities;
|
||||
|
||||
namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
@@ -131,7 +132,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
for (int i = 0; i < lists.Count; i++) {
|
||||
foreach (object o in lists [i]) {
|
||||
if (o is string)
|
||||
expressionCollection.Add (Utilities.Unescape ((string) o));
|
||||
expressionCollection.Add (MSBuildUtils.Unescape ((string) o));
|
||||
else if (!allowItems && o is ItemReference)
|
||||
expressionCollection.Add (((ItemReference) o).OriginalString);
|
||||
else if (!allowMd && o is MetadataReference) {
|
||||
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// ExpressionEvaluationException.cs
|
||||
//
|
||||
// Author:
|
||||
// Ankit Jain ([email protected])
|
||||
//
|
||||
// Copyright 2011 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#if NET_2_0
|
||||
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Microsoft.Build.BuildEngine {
|
||||
[Serializable]
|
||||
internal class ExpressionEvaluationException : Exception {
|
||||
|
||||
public ExpressionEvaluationException ()
|
||||
: base ("Exception occured when evaluating the expression.")
|
||||
{
|
||||
}
|
||||
|
||||
public ExpressionEvaluationException (string message)
|
||||
: base (message)
|
||||
{
|
||||
}
|
||||
|
||||
public ExpressionEvaluationException (string message,
|
||||
Exception innerException)
|
||||
: base (message, innerException)
|
||||
{
|
||||
}
|
||||
|
||||
protected ExpressionEvaluationException (SerializationInfo info,
|
||||
StreamingContext context)
|
||||
: base (info, context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
+29
-14
@@ -180,8 +180,13 @@ namespace Microsoft.Build.BuildEngine {
|
||||
while (evaluate_iterator != null) {
|
||||
if (evaluate_iterator.Value is BuildPropertyGroup) {
|
||||
bpg = (BuildPropertyGroup) evaluate_iterator.Value;
|
||||
if (ConditionParser.ParseAndEvaluate (bpg.Condition, project))
|
||||
bpg.Evaluate ();
|
||||
project.PushThisFileProperty (bpg.DefinedInFileName);
|
||||
try {
|
||||
if (ConditionParser.ParseAndEvaluate (bpg.Condition, project))
|
||||
bpg.Evaluate ();
|
||||
} finally {
|
||||
project.PopThisFileProperty ();
|
||||
}
|
||||
}
|
||||
|
||||
// if it wasn't moved by adding anything because of evaluating a Import shift it
|
||||
@@ -197,8 +202,13 @@ namespace Microsoft.Build.BuildEngine {
|
||||
while (evaluate_iterator != null) {
|
||||
if (evaluate_iterator.Value is BuildItemGroup) {
|
||||
big = (BuildItemGroup) evaluate_iterator.Value;
|
||||
if (ConditionParser.ParseAndEvaluate (big.Condition, project))
|
||||
big.Evaluate ();
|
||||
project.PushThisFileProperty (big.DefinedInFileName);
|
||||
try {
|
||||
if (ConditionParser.ParseAndEvaluate (big.Condition, project))
|
||||
big.Evaluate ();
|
||||
} finally {
|
||||
project.PopThisFileProperty ();
|
||||
}
|
||||
}
|
||||
|
||||
evaluate_iterator = evaluate_iterator.Next;
|
||||
@@ -210,17 +220,22 @@ namespace Microsoft.Build.BuildEngine {
|
||||
while (evaluate_iterator != null) {
|
||||
if (evaluate_iterator.Value is BuildChoose) {
|
||||
BuildChoose bc = (BuildChoose)evaluate_iterator.Value;
|
||||
bool whenUsed = false;
|
||||
foreach (BuildWhen bw in bc.Whens) {
|
||||
if (ConditionParser.ParseAndEvaluate (bw.Condition, project)) {
|
||||
bw.Evaluate ();
|
||||
whenUsed = true;
|
||||
break;
|
||||
project.PushThisFileProperty (bc.DefinedInFileName);
|
||||
try {
|
||||
bool whenUsed = false;
|
||||
foreach (BuildWhen bw in bc.Whens) {
|
||||
if (ConditionParser.ParseAndEvaluate (bw.Condition, project)) {
|
||||
bw.Evaluate ();
|
||||
whenUsed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!whenUsed && bc.Otherwise != null &&
|
||||
ConditionParser.ParseAndEvaluate (bc.Otherwise.Condition, project)) {
|
||||
bc.Otherwise.Evaluate ();
|
||||
if (!whenUsed && bc.Otherwise != null &&
|
||||
ConditionParser.ParseAndEvaluate (bc.Otherwise.Condition, project)) {
|
||||
bc.Otherwise.Evaluate ();
|
||||
}
|
||||
} finally {
|
||||
project.PopThisFileProperty ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ using System.IO;
|
||||
using System.Xml;
|
||||
|
||||
using Microsoft.Build.Framework;
|
||||
using Mono.XBuild.Utilities;
|
||||
|
||||
namespace Microsoft.Build.BuildEngine {
|
||||
public class Import {
|
||||
@@ -43,6 +44,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
static string DotConfigExtensionsPath = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData),
|
||||
Path.Combine ("xbuild", "tasks"));
|
||||
const string MacOSXExternalXBuildDir = "/Library/Frameworks/Mono.framework/External/xbuild";
|
||||
static string PathSeparatorAsString = Path.PathSeparator.ToString ();
|
||||
|
||||
internal Import (XmlElement importElement, Project project, ImportedProject originalProject)
|
||||
{
|
||||
@@ -118,14 +120,14 @@ namespace Microsoft.Build.BuildEngine {
|
||||
// project.
|
||||
|
||||
string envvar = Environment.GetEnvironmentVariable (property_name);
|
||||
envvar = String.Join (":", new string [] {
|
||||
envvar = String.Join (PathSeparatorAsString, new string [] {
|
||||
(envvar ?? String.Empty),
|
||||
// For mac osx, look in the 'External' dir on macosx,
|
||||
// see bug #663180
|
||||
Microsoft.Build.Tasks.Utilities.RunningOnMac ? MacOSXExternalXBuildDir : String.Empty,
|
||||
(envvar ?? String.Empty),
|
||||
MSBuildUtils.RunningOnMac ? MacOSXExternalXBuildDir : String.Empty,
|
||||
DotConfigExtensionsPath});
|
||||
|
||||
string [] paths = envvar.Split (new char [] {':'}, StringSplitOptions.RemoveEmptyEntries);
|
||||
string [] paths = envvar.Split (new char [] {Path.PathSeparator}, StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach (string path in paths) {
|
||||
if (!Directory.Exists (path)) {
|
||||
project.ParentEngine.LogMessage (MessageImportance.Low, "Extension path '{0}' not found, ignoring.", path);
|
||||
@@ -173,7 +175,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
file = Path.Combine (dir, EvaluatedProjectPath);
|
||||
}
|
||||
|
||||
return Utilities.FromMSBuildPath (file);
|
||||
return MSBuildUtils.FromMSBuildPath (file);
|
||||
}
|
||||
|
||||
public string Condition {
|
||||
|
||||
@@ -73,10 +73,14 @@ namespace Microsoft.Build.BuildEngine {
|
||||
XmlDocument xmlDocument;
|
||||
bool unloaded;
|
||||
bool initialTargetsBuilt;
|
||||
List<string> builtTargetKeys;
|
||||
bool building;
|
||||
BuildSettings current_settings;
|
||||
Stack<Batch> batches;
|
||||
|
||||
// This is used to keep track of "current" file,
|
||||
// which is then used to set the reserved properties
|
||||
// $(MSBuildThisFile*)
|
||||
Stack<string> this_file_property_stack;
|
||||
ProjectLoadSettings project_load_settings;
|
||||
|
||||
|
||||
@@ -111,10 +115,10 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
encoding = null;
|
||||
|
||||
builtTargetKeys = new List<string> ();
|
||||
initialTargets = new List<string> ();
|
||||
defaultTargets = new string [0];
|
||||
batches = new Stack<Batch> ();
|
||||
this_file_property_stack = new Stack<string> ();
|
||||
|
||||
globalProperties = new BuildPropertyGroup (null, this, null, false);
|
||||
foreach (BuildProperty bp in parentEngine.GlobalProperties)
|
||||
@@ -279,6 +283,11 @@ namespace Microsoft.Build.BuildEngine {
|
||||
{
|
||||
bool result = false;
|
||||
ParentEngine.StartProjectBuild (this, targetNames);
|
||||
|
||||
// Invoking this to emit a warning in case of unsupported
|
||||
// ToolsVersion
|
||||
GetToolsVersionToUse (true);
|
||||
|
||||
string current_directory = Environment.CurrentDirectory;
|
||||
try {
|
||||
current_settings = buildFlags;
|
||||
@@ -301,16 +310,24 @@ namespace Microsoft.Build.BuildEngine {
|
||||
BuildSettings buildFlags)
|
||||
{
|
||||
CheckUnloaded ();
|
||||
if (buildFlags == BuildSettings.None)
|
||||
if (buildFlags == BuildSettings.None) {
|
||||
needToReevaluate = false;
|
||||
Reevaluate ();
|
||||
}
|
||||
|
||||
if (targetNames == null || targetNames.Length == 0) {
|
||||
if (defaultTargets != null && defaultTargets.Length != 0)
|
||||
if (defaultTargets != null && defaultTargets.Length != 0) {
|
||||
targetNames = defaultTargets;
|
||||
else if (firstTargetName != null)
|
||||
} else if (firstTargetName != null) {
|
||||
targetNames = new string [1] { firstTargetName};
|
||||
else
|
||||
} else {
|
||||
if (targets == null || targets.Count == 0) {
|
||||
LogError (fullFileName, "No target found in the project");
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!initialTargetsBuilt) {
|
||||
@@ -351,9 +368,16 @@ namespace Microsoft.Build.BuildEngine {
|
||||
}
|
||||
|
||||
internal string GetKeyForTarget (string target_name)
|
||||
{
|
||||
return GetKeyForTarget (target_name, true);
|
||||
}
|
||||
|
||||
internal string GetKeyForTarget (string target_name, bool include_global_properties)
|
||||
{
|
||||
// target name is case insensitive
|
||||
return fullFileName + ":" + target_name.ToLower () + ":" + GlobalPropertiesToString (GlobalProperties);
|
||||
return fullFileName + ":" + target_name.ToLower () +
|
||||
(include_global_properties ? (":" + GlobalPropertiesToString (GlobalProperties))
|
||||
: String.Empty);
|
||||
}
|
||||
|
||||
string GlobalPropertiesToString (BuildPropertyGroup bgp)
|
||||
@@ -445,6 +469,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
"projectFileName");
|
||||
|
||||
this.fullFileName = Utilities.FromMSBuildPath (Path.GetFullPath (projectFileName));
|
||||
PushThisFileProperty (fullFileName);
|
||||
|
||||
string filename = fullFileName;
|
||||
if (String.Compare (Path.GetExtension (fullFileName), ".sln", true) == 0) {
|
||||
@@ -798,7 +823,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
targets = new TargetCollection (this);
|
||||
last_item_group_containing = new Dictionary <string, BuildItemGroup> ();
|
||||
|
||||
string effective_tools_version = GetToolsVersionToUse ();
|
||||
string effective_tools_version = GetToolsVersionToUse (false);
|
||||
taskDatabase = new TaskDatabase ();
|
||||
taskDatabase.CopyTasks (ParentEngine.GetDefaultTasks (effective_tools_version));
|
||||
|
||||
@@ -863,7 +888,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
AddPropertyGroup (xe, ip);
|
||||
break;
|
||||
case "Choose":
|
||||
AddChoose (xe);
|
||||
AddChoose (xe, ip);
|
||||
break;
|
||||
default:
|
||||
throw new InvalidProjectFileException (String.Format ("Invalid element '{0}' in project file.", xe.Name));
|
||||
@@ -896,8 +921,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
// Removes entries of all earlier built targets for this project
|
||||
void RemoveBuiltTargets ()
|
||||
{
|
||||
foreach (string key in builtTargetKeys)
|
||||
ParentEngine.BuiltTargetsOutputByName.Remove (key);
|
||||
ParentEngine.ClearBuiltTargetsForProject (this);
|
||||
}
|
||||
|
||||
void InitializeProperties (string effective_tools_version)
|
||||
@@ -908,7 +932,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
foreach (BuildProperty gp in GlobalProperties) {
|
||||
bp = new BuildProperty (gp.Name, gp.Value, PropertyType.Global);
|
||||
EvaluatedProperties.AddProperty (bp);
|
||||
evaluatedProperties.AddProperty (bp);
|
||||
}
|
||||
|
||||
foreach (BuildProperty gp in GlobalProperties)
|
||||
@@ -917,38 +941,38 @@ namespace Microsoft.Build.BuildEngine {
|
||||
// add properties that we dont have from parent engine's
|
||||
// global properties
|
||||
foreach (BuildProperty gp in ParentEngine.GlobalProperties) {
|
||||
if (EvaluatedProperties [gp.Name] == null) {
|
||||
if (evaluatedProperties [gp.Name] == null) {
|
||||
bp = new BuildProperty (gp.Name, gp.Value, PropertyType.Global);
|
||||
EvaluatedProperties.AddProperty (bp);
|
||||
evaluatedProperties.AddProperty (bp);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (DictionaryEntry de in Environment.GetEnvironmentVariables ()) {
|
||||
bp = new BuildProperty ((string) de.Key, (string) de.Value, PropertyType.Environment);
|
||||
EvaluatedProperties.AddProperty (bp);
|
||||
evaluatedProperties.AddProperty (bp);
|
||||
}
|
||||
|
||||
EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectFile", Path.GetFileName (fullFileName),
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectFile", Path.GetFileName (fullFileName),
|
||||
PropertyType.Reserved));
|
||||
EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectFullPath", fullFileName, PropertyType.Reserved));
|
||||
EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectName",
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectFullPath", fullFileName, PropertyType.Reserved));
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectName",
|
||||
Path.GetFileNameWithoutExtension (fullFileName),
|
||||
PropertyType.Reserved));
|
||||
EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectExtension",
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectExtension",
|
||||
Path.GetExtension (fullFileName),
|
||||
PropertyType.Reserved));
|
||||
|
||||
string toolsPath = parentEngine.Toolsets [effective_tools_version].ToolsPath;
|
||||
if (toolsPath == null)
|
||||
throw new Exception (String.Format ("Invalid tools version '{0}', no tools path set for this.", effective_tools_version));
|
||||
EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildBinPath", toolsPath, PropertyType.Reserved));
|
||||
EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildToolsPath", toolsPath, PropertyType.Reserved));
|
||||
EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildToolsVersion", effective_tools_version, PropertyType.Reserved));
|
||||
EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildExtensionsPath", ExtensionsPath, PropertyType.Reserved));
|
||||
EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildExtensionsPath32", ExtensionsPath, PropertyType.Reserved));
|
||||
EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildExtensionsPath64", ExtensionsPath, PropertyType.Reserved));
|
||||
EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectDefaultTargets", DefaultTargets, PropertyType.Reserved));
|
||||
EvaluatedProperties.AddProperty (new BuildProperty ("OS", OS, PropertyType.Environment));
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildBinPath", toolsPath, PropertyType.Reserved));
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildToolsPath", toolsPath, PropertyType.Reserved));
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildToolsVersion", effective_tools_version, PropertyType.Reserved));
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildExtensionsPath", ExtensionsPath, PropertyType.Reserved));
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildExtensionsPath32", ExtensionsPath, PropertyType.Reserved));
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildExtensionsPath64", ExtensionsPath, PropertyType.Reserved));
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectDefaultTargets", DefaultTargets, PropertyType.Reserved));
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("OS", OS, PropertyType.Environment));
|
||||
|
||||
// FIXME: make some internal method that will work like GetDirectoryName but output String.Empty on null/String.Empty
|
||||
string projectDir;
|
||||
@@ -957,14 +981,19 @@ namespace Microsoft.Build.BuildEngine {
|
||||
else
|
||||
projectDir = Path.GetDirectoryName (FullFileName);
|
||||
|
||||
EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectDirectory", projectDir, PropertyType.Reserved));
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectDirectory", projectDir, PropertyType.Reserved));
|
||||
|
||||
if (this_file_property_stack.Count > 0)
|
||||
// Just re-inited the properties, but according to the stack,
|
||||
// we should have a MSBuild*This* property set
|
||||
SetMSBuildThisFileProperties (this_file_property_stack.Peek ());
|
||||
}
|
||||
|
||||
// precedence:
|
||||
// ToolsVersion property
|
||||
// ToolsVersion attribute on the project
|
||||
// parentEngine's DefaultToolsVersion
|
||||
string GetToolsVersionToUse ()
|
||||
string GetToolsVersionToUse (bool emitWarning)
|
||||
{
|
||||
if (!String.IsNullOrEmpty (ToolsVersion))
|
||||
return ToolsVersion;
|
||||
@@ -973,7 +1002,8 @@ namespace Microsoft.Build.BuildEngine {
|
||||
return parentEngine.DefaultToolsVersion;
|
||||
|
||||
if (parentEngine.Toolsets [DefaultToolsVersion] == null) {
|
||||
LogWarning (FullFileName, "Project has unknown ToolsVersion '{0}'. Using the default tools version '{1}' instead.",
|
||||
if (emitWarning)
|
||||
LogWarning (FullFileName, "Project has unknown ToolsVersion '{0}'. Using the default tools version '{1}' instead.",
|
||||
DefaultToolsVersion, parentEngine.DefaultToolsVersion);
|
||||
return parentEngine.DefaultToolsVersion;
|
||||
}
|
||||
@@ -1048,9 +1078,9 @@ namespace Microsoft.Build.BuildEngine {
|
||||
PropertyGroups.Add (bpg);
|
||||
}
|
||||
|
||||
void AddChoose (XmlElement xmlElement)
|
||||
void AddChoose (XmlElement xmlElement, ImportedProject importedProject)
|
||||
{
|
||||
BuildChoose bc = new BuildChoose (xmlElement, this);
|
||||
BuildChoose bc = new BuildChoose (xmlElement, this, importedProject);
|
||||
groupingCollection.Add (bc);
|
||||
}
|
||||
|
||||
@@ -1243,6 +1273,41 @@ namespace Microsoft.Build.BuildEngine {
|
||||
return default (T);
|
||||
}
|
||||
|
||||
// Used for MSBuild*This* set of properties
|
||||
internal void PushThisFileProperty (string full_filename)
|
||||
{
|
||||
string last_file = this_file_property_stack.Count == 0 ? String.Empty : this_file_property_stack.Peek ();
|
||||
this_file_property_stack.Push (full_filename);
|
||||
if (last_file != full_filename)
|
||||
// first time, or different from previous one
|
||||
SetMSBuildThisFileProperties (full_filename);
|
||||
}
|
||||
|
||||
internal void PopThisFileProperty ()
|
||||
{
|
||||
string last_file = this_file_property_stack.Pop ();
|
||||
if (this_file_property_stack.Count > 0 && last_file != this_file_property_stack.Peek ())
|
||||
SetMSBuildThisFileProperties (this_file_property_stack.Peek ());
|
||||
}
|
||||
|
||||
void SetMSBuildThisFileProperties (string full_filename)
|
||||
{
|
||||
if (String.IsNullOrEmpty (full_filename))
|
||||
return;
|
||||
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildThisFile", Path.GetFileName (full_filename), PropertyType.Reserved));
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildThisFileFullPath", full_filename, PropertyType.Reserved));
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildThisFileName", Path.GetFileNameWithoutExtension (full_filename), PropertyType.Reserved));
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildThisFileExtension", Path.GetExtension (full_filename), PropertyType.Reserved));
|
||||
|
||||
string project_dir = Path.GetDirectoryName (full_filename) + Path.DirectorySeparatorChar;
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildThisFileDirectory", project_dir, PropertyType.Reserved));
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildThisFileDirectoryNoRoot",
|
||||
project_dir.Substring (Path.GetPathRoot (project_dir).Length),
|
||||
PropertyType.Reserved));
|
||||
}
|
||||
|
||||
|
||||
internal void LogWarning (string filename, string message, params object[] messageArgs)
|
||||
{
|
||||
BuildWarningEventArgs bwea = new BuildWarningEventArgs (
|
||||
@@ -1396,10 +1461,6 @@ namespace Microsoft.Build.BuildEngine {
|
||||
get; internal set;
|
||||
}
|
||||
|
||||
internal List<string> BuiltTargetKeys {
|
||||
get { return builtTargetKeys; }
|
||||
}
|
||||
|
||||
internal Dictionary <string, BuildItemGroup> LastItemGroupContaining {
|
||||
get { return last_item_group_containing; }
|
||||
}
|
||||
|
||||
@@ -122,6 +122,16 @@ namespace Microsoft.Build.BuildEngine {
|
||||
}
|
||||
|
||||
bool Build (string built_targets_key, out bool executeOnErrors)
|
||||
{
|
||||
project.PushThisFileProperty (TargetFile);
|
||||
try {
|
||||
return BuildActual (built_targets_key, out executeOnErrors);
|
||||
} finally {
|
||||
project.PopThisFileProperty ();
|
||||
}
|
||||
}
|
||||
|
||||
bool BuildActual (string built_targets_key, out bool executeOnErrors)
|
||||
{
|
||||
bool result = false;
|
||||
executeOnErrors = false;
|
||||
@@ -165,7 +175,6 @@ namespace Microsoft.Build.BuildEngine {
|
||||
}
|
||||
|
||||
project.ParentEngine.BuiltTargetsOutputByName [built_targets_key] = (ITaskItem[]) Outputs.Clone ();
|
||||
project.BuiltTargetKeys.Add (built_targets_key);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -30,154 +30,19 @@
|
||||
|
||||
#if NET_2_0
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Mono.XBuild.Utilities;
|
||||
|
||||
namespace Microsoft.Build.BuildEngine {
|
||||
public static class Utilities {
|
||||
|
||||
static Hashtable charsToEscape;
|
||||
|
||||
static Utilities ()
|
||||
{
|
||||
charsToEscape = new Hashtable ();
|
||||
|
||||
charsToEscape.Add ('$', null);
|
||||
charsToEscape.Add ('%', null);
|
||||
charsToEscape.Add ('\'', null);
|
||||
charsToEscape.Add ('(', null);
|
||||
charsToEscape.Add (')', null);
|
||||
charsToEscape.Add ('*', null);
|
||||
charsToEscape.Add (';', null);
|
||||
charsToEscape.Add ('?', null);
|
||||
charsToEscape.Add ('@', null);
|
||||
}
|
||||
|
||||
|
||||
public static string Escape (string unescapedExpression)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
|
||||
foreach (char c in unescapedExpression) {
|
||||
if (charsToEscape.Contains (c))
|
||||
sb.AppendFormat ("%{0:x2}", (int) c);
|
||||
else
|
||||
sb.Append (c);
|
||||
}
|
||||
|
||||
return sb.ToString ();
|
||||
return MSBuildUtils.Escape (unescapedExpression);
|
||||
}
|
||||
|
||||
// FIXME: add tests for this
|
||||
internal static string Unescape (string escapedExpression)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
|
||||
int i = 0;
|
||||
while (i < escapedExpression.Length) {
|
||||
sb.Append (Uri.HexUnescape (escapedExpression, ref i));
|
||||
}
|
||||
|
||||
return sb.ToString ();
|
||||
}
|
||||
|
||||
internal static string UnescapeFromXml (string text)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
for (int i = 0; i < text.Length; i++) {
|
||||
char c1 = text[i];
|
||||
if (c1 == '&') {
|
||||
int end = text.IndexOf (';', i);
|
||||
if (end == -1)
|
||||
throw new FormatException ("Unterminated XML entity.");
|
||||
string entity = text.Substring (i+1, end - i - 1);
|
||||
switch (entity) {
|
||||
case "lt":
|
||||
sb.Append ('<');
|
||||
break;
|
||||
case "gt":
|
||||
sb.Append ('>');
|
||||
break;
|
||||
case "amp":
|
||||
sb.Append ('&');
|
||||
break;
|
||||
case "apos":
|
||||
sb.Append ('\'');
|
||||
break;
|
||||
case "quot":
|
||||
sb.Append ('"');
|
||||
break;
|
||||
default:
|
||||
throw new FormatException ("Unrecogised XML entity '&" + entity + ";'.");
|
||||
}
|
||||
i = end;
|
||||
} else
|
||||
sb.Append (c1);
|
||||
}
|
||||
return sb.ToString ();
|
||||
}
|
||||
|
||||
|
||||
internal static string FromMSBuildPath (string relPath)
|
||||
{
|
||||
if (relPath == null || relPath.Length == 0)
|
||||
return null;
|
||||
|
||||
bool is_windows = Path.DirectorySeparatorChar == '\\';
|
||||
string path = relPath;
|
||||
if (!is_windows)
|
||||
path = path.Replace ("\\", "/");
|
||||
|
||||
// a path with drive letter is invalid/unusable on non-windows
|
||||
if (!is_windows && char.IsLetter (path [0]) && path.Length > 1 && path[1] == ':')
|
||||
return null;
|
||||
|
||||
if (System.IO.File.Exists (path)){
|
||||
return Path.GetFullPath (path);
|
||||
}
|
||||
|
||||
if (Path.IsPathRooted (path)) {
|
||||
|
||||
// Windows paths are case-insensitive. When mapping an absolute path
|
||||
// we can try to find the correct case for the path.
|
||||
|
||||
string[] names = path.Substring (1).Split ('/');
|
||||
string part = "/";
|
||||
|
||||
for (int n=0; n<names.Length; n++) {
|
||||
string[] entries;
|
||||
|
||||
if (names [n] == ".."){
|
||||
if (part == "/")
|
||||
return ""; // Can go further back. It's not an existing file
|
||||
part = Path.GetFullPath (part + "/..");
|
||||
continue;
|
||||
}
|
||||
|
||||
entries = Directory.GetFileSystemEntries (part);
|
||||
|
||||
string fpath = null;
|
||||
foreach (string e in entries) {
|
||||
if (string.Compare (Path.GetFileName (e), names[n], true) == 0) {
|
||||
fpath = e;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (fpath == null) {
|
||||
// Part of the path does not exist. Can't do any more checking.
|
||||
part = Path.GetFullPath (part);
|
||||
for (; n < names.Length; n++)
|
||||
part += "/" + names[n];
|
||||
return part;
|
||||
}
|
||||
|
||||
part = fpath;
|
||||
}
|
||||
return Path.GetFullPath (part);
|
||||
} else {
|
||||
return Path.GetFullPath (path);
|
||||
}
|
||||
return MSBuildUtils.FromMSBuildPath (relPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
../../build/common/MonoTODOAttribute.cs
|
||||
Assembly/AssemblyInfo.cs
|
||||
../Microsoft.Build.Framework/Mono.XBuild.Framework/AssemblyLoadInfo.cs
|
||||
../Microsoft.Build.Tasks/Microsoft.Build.Tasks/Utilities.cs
|
||||
../Microsoft.Build.Utilities/Mono.XBuild.Utilities/MSBuildUtils.cs
|
||||
../Microsoft.Build.Utilities/Mono.XBuild.Utilities/ReservedNameUtils.cs
|
||||
../../tools/xbuild/SolutionParser.cs
|
||||
Microsoft.Build.BuildEngine/BatchingImplBase.cs
|
||||
@@ -37,6 +37,7 @@ Microsoft.Build.BuildEngine/Engine.cs
|
||||
Microsoft.Build.BuildEngine/EventSource.cs
|
||||
Microsoft.Build.BuildEngine/Expression.cs
|
||||
Microsoft.Build.BuildEngine/ExpressionCollection.cs
|
||||
Microsoft.Build.BuildEngine/ExpressionEvaluationException.cs
|
||||
Microsoft.Build.BuildEngine/ExpressionParseException.cs
|
||||
Microsoft.Build.BuildEngine/FileLogger.cs
|
||||
Microsoft.Build.BuildEngine/GroupingCollection.cs
|
||||
|
||||
@@ -862,9 +862,10 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
|
||||
|
||||
CreateAndCheckGlobalPropertiesTest (mainProject, firstProject, secondProject,
|
||||
null, null,
|
||||
4, 3, 12,
|
||||
4, 3, 13,
|
||||
new string [] {
|
||||
"foofoo;barbar;foofoo;barbar: F.Unique: true",
|
||||
"foofoo;barbar: F.Unique: true",
|
||||
"foofoo;barbar: F.Unique: false",
|
||||
"from_second: F.Unique: unique",
|
||||
"foofoo;foofoo;from_second: F.Prop1: false",
|
||||
"barbar;barbar: F.Prop1: bar_false",
|
||||
|
||||
@@ -1831,6 +1831,97 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestMSBuildThisProperties ()
|
||||
{
|
||||
Engine engine = new Engine (Consts.BinPath);
|
||||
Project project = engine.CreateNewProject ();
|
||||
|
||||
string base_dir = Path.GetFullPath (Path.Combine ("Test", "resources")) + Path.DirectorySeparatorChar;
|
||||
string tmp_dir = Path.GetFullPath (Path.Combine (base_dir, "tmp")) + Path.DirectorySeparatorChar;
|
||||
|
||||
string first_project = Path.Combine (base_dir, "first.proj");
|
||||
string second_project = Path.Combine (tmp_dir, "second.proj");
|
||||
string third_project = Path.Combine (tmp_dir, "third.proj");
|
||||
|
||||
string first = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" " + Consts.ToolsVersionString + @">
|
||||
<PropertyGroup>
|
||||
<FooInMain>$(MSBuildThisFileDirectory)</FooInMain>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ItemInMain Include=""$(MSBuildThisFileFullPath)"" />
|
||||
</ItemGroup>
|
||||
<Import Project=""tmp\second.proj""/>
|
||||
</Project>";
|
||||
|
||||
string second = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" " + Consts.ToolsVersionString + @">
|
||||
<PropertyGroup>
|
||||
<FooInImport1>$(MSBuildThisFileDirectory)</FooInImport1>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<FooInImport2>$(MSBuildThisFileDirectory)</FooInImport2>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ItemInImport1 Include=""$(MSBuildThisFileFullPath)"" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project=""third.proj""/>
|
||||
</Project>";
|
||||
|
||||
string third = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" " + Consts.ToolsVersionString + @">
|
||||
<PropertyGroup>
|
||||
<FooInTwo>$(MSBuildThisFileFullPath)</FooInTwo>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ItemInTwo Include=""$(MSBuildThisFileFullPath)"" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name=""TargetInTwo"">
|
||||
<Message Text=""FooInMain: $(FooInMain)""/>
|
||||
<Message Text=""FooInImport1: $(FooInImport1)""/>
|
||||
<Message Text=""FooInImport2: $(FooInImport2)""/>
|
||||
<Message Text=""FooInTwo: $(FooInTwo)""/>
|
||||
|
||||
<Message Text=""ItemInMain: %(ItemInMain.Identity)""/>
|
||||
<Message Text=""ItemInImport1: %(ItemInImport1.Identity)""/>
|
||||
<Message Text=""ItemInTwo: %(ItemInTwo.Identity)""/>
|
||||
<Message Text=""Full path: $(MSBuildThisFileFullPath)""/>
|
||||
</Target>
|
||||
</Project>";
|
||||
|
||||
File.WriteAllText (first_project, first);
|
||||
|
||||
Directory.CreateDirectory (Path.Combine (base_dir, "tmp"));
|
||||
File.WriteAllText (second_project, second);
|
||||
File.WriteAllText (third_project, third);
|
||||
|
||||
MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
|
||||
new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
|
||||
engine.RegisterLogger (logger);
|
||||
|
||||
project.Load (first_project);
|
||||
try {
|
||||
Assert.IsTrue (project.Build (), "Build failed");
|
||||
|
||||
logger.CheckLoggedMessageHead ("FooInMain: " + base_dir, "A1");
|
||||
logger.CheckLoggedMessageHead ("FooInImport1: " + tmp_dir, "A2");
|
||||
logger.CheckLoggedMessageHead ("FooInImport2: " + tmp_dir, "A3");
|
||||
logger.CheckLoggedMessageHead ("FooInTwo: " + third_project, "A4");
|
||||
logger.CheckLoggedMessageHead ("ItemInMain: " + first_project, "A5");
|
||||
logger.CheckLoggedMessageHead ("ItemInImport1: " + second_project, "A6");
|
||||
logger.CheckLoggedMessageHead ("ItemInTwo: " + third_project, "A7");
|
||||
logger.CheckLoggedMessageHead ("Full path: " + third_project, "A8");
|
||||
|
||||
Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
|
||||
} catch {
|
||||
logger.DumpMessages ();
|
||||
throw;
|
||||
} finally {
|
||||
File.Delete (first_project);
|
||||
File.Delete (second_project);
|
||||
File.Delete (third_project);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestRequiredTask_String1 ()
|
||||
|
||||
@@ -336,6 +336,27 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
|
||||
Assert.AreEqual ("fr_c.txt", bgp [2].FinalItemSpec, "A4");
|
||||
}
|
||||
|
||||
// Test shortcircuiting
|
||||
[Test]
|
||||
public void TestCondition12 ()
|
||||
{
|
||||
Engine engine = new Engine (Consts.BinPath);
|
||||
Project proj = engine.CreateNewProject ();
|
||||
|
||||
string documentString = @"
|
||||
<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
|
||||
<PropertyGroup>
|
||||
<A Condition=""'$(NonExistant)' != '' and $(NonExistant)""></A>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
";
|
||||
|
||||
proj.LoadXml (documentString);
|
||||
|
||||
Assert.IsNull (proj.EvaluatedProperties ["A"], "A1");
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void TestHasTrailingSlash1 ()
|
||||
{
|
||||
@@ -481,5 +502,24 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
|
||||
|
||||
proj.LoadXml (documentString);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (InvalidProjectFileException))]
|
||||
public void TestIncorrectCondition6 ()
|
||||
{
|
||||
Engine engine = new Engine (Consts.BinPath);
|
||||
Project proj = engine.CreateNewProject ();
|
||||
|
||||
string documentString = @"
|
||||
<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
|
||||
<ItemGroup>
|
||||
<A Include='a' Condition=""'$(NonExistant)' != '' or $(NonExistant)""/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
";
|
||||
|
||||
proj.LoadXml (documentString);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -104,7 +104,6 @@ Microsoft.Build.Tasks/ToolTaskExtension.cs
|
||||
Microsoft.Build.Tasks/Touch.cs
|
||||
Microsoft.Build.Tasks/UnregisterAssembly.cs
|
||||
Microsoft.Build.Tasks/UpdateManifest.cs
|
||||
Microsoft.Build.Tasks/Utilities.cs
|
||||
Microsoft.Build.Tasks/Vbc.cs
|
||||
Microsoft.Build.Tasks/VCBuild.cs
|
||||
Microsoft.Build.Tasks/Warning.cs
|
||||
@@ -113,5 +112,6 @@ Mono.XBuild.Tasks.GenerateResourceInternal/PoResourceReader.cs
|
||||
Mono.XBuild.Tasks.GenerateResourceInternal/PoResourceWriter.cs
|
||||
Mono.XBuild.Tasks.GenerateResourceInternal/TxtResourceReader.cs
|
||||
Mono.XBuild.Tasks.GenerateResourceInternal/TxtResourceWriter.cs
|
||||
../Microsoft.Build.Utilities/Mono.XBuild.Utilities/MSBuildUtils.cs
|
||||
../Microsoft.Build.Engine/Microsoft.Build.BuildEngine/DirectoryScanner.cs
|
||||
../Microsoft.Build.Engine/Microsoft.Build.BuildEngine/UnknownToolsVersionException.cs
|
||||
@@ -237,7 +237,7 @@ namespace Microsoft.Build.Tasks {
|
||||
|
||||
protected override string ToolName {
|
||||
get {
|
||||
return Utilities.RunningOnWindows ? "al.bat" : "al";
|
||||
return MSBuildUtils.RunningOnWindows ? "al.bat" : "al";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.Build.Framework;
|
||||
using Mono.XBuild.Utilities;
|
||||
|
||||
namespace Microsoft.Build.Tasks {
|
||||
public class AspNetCompiler : ToolTaskExtension {
|
||||
@@ -142,7 +143,7 @@ namespace Microsoft.Build.Tasks {
|
||||
}
|
||||
|
||||
protected override string ToolName {
|
||||
get { return Utilities.RunningOnWindows ? "aspnet_compiler.bat" : "aspnet_compiler"; }
|
||||
get { return MSBuildUtils.RunningOnWindows ? "aspnet_compiler.bat" : "aspnet_compiler"; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,24 +54,30 @@ namespace Microsoft.Build.Tasks {
|
||||
assignedFiles = new ITaskItem [files.Length];
|
||||
for (int i = 0; i < files.Length; i ++) {
|
||||
string file = files [i].ItemSpec;
|
||||
string link = files [i].GetMetadata ("Link");
|
||||
string afile = null;
|
||||
//FIXME: Hack!
|
||||
string normalized_root = Path.GetFullPath (rootFolder);
|
||||
|
||||
// cur dir should already be set to
|
||||
// the project dir
|
||||
file = Path.GetFullPath (file);
|
||||
if (String.IsNullOrEmpty (link)) {
|
||||
//FIXME: Hack!
|
||||
string normalized_root = Path.GetFullPath (rootFolder);
|
||||
|
||||
if (file.StartsWith (normalized_root)) {
|
||||
afile = Path.GetFullPath (file).Substring (
|
||||
normalized_root.Length);
|
||||
// skip over "root/"
|
||||
if (afile [0] == '\\' ||
|
||||
afile [0] == '/')
|
||||
afile = afile.Substring (1);
|
||||
// cur dir should already be set to
|
||||
// the project dir
|
||||
file = Path.GetFullPath (file);
|
||||
|
||||
if (file.StartsWith (normalized_root)) {
|
||||
afile = Path.GetFullPath (file).Substring (
|
||||
normalized_root.Length);
|
||||
// skip over "root/"
|
||||
if (afile [0] == '\\' ||
|
||||
afile [0] == '/')
|
||||
afile = afile.Substring (1);
|
||||
|
||||
} else {
|
||||
afile = Path.GetFileName (file);
|
||||
}
|
||||
} else {
|
||||
afile = Path.GetFileName (file);
|
||||
afile = link;
|
||||
}
|
||||
|
||||
assignedFiles [i] = new TaskItem (files [i]);
|
||||
|
||||
@@ -32,6 +32,7 @@ using System.IO;
|
||||
using Microsoft.Build.Framework;
|
||||
using Microsoft.Build.Tasks.Hosting;
|
||||
using Microsoft.Build.Utilities;
|
||||
using Mono.XBuild.Utilities;
|
||||
|
||||
namespace Microsoft.Build.Tasks {
|
||||
public class Csc : ManagedCompiler {
|
||||
@@ -195,9 +196,9 @@ namespace Microsoft.Build.Tasks {
|
||||
protected override string ToolName {
|
||||
get {
|
||||
#if NET_4_0
|
||||
return Utilities.RunningOnWindows ? "dmcs.bat" : "dmcs";
|
||||
return MSBuildUtils.RunningOnWindows ? "dmcs.bat" : "dmcs";
|
||||
#else
|
||||
return Utilities.RunningOnWindows ? "gmcs.bat" : "gmcs";
|
||||
return MSBuildUtils.RunningOnWindows ? "gmcs.bat" : "gmcs";
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ using System.Xml;
|
||||
using Microsoft.Build.Framework;
|
||||
using Microsoft.Build.Utilities;
|
||||
using Mono.XBuild.Tasks.GenerateResourceInternal;
|
||||
using Mono.XBuild.Utilities;
|
||||
|
||||
namespace Microsoft.Build.Tasks {
|
||||
public sealed class GenerateResource : TaskExtension {
|
||||
@@ -155,7 +156,7 @@ namespace Microsoft.Build.Tasks {
|
||||
|
||||
string [] parts = value.Split (';');
|
||||
if (parts.Length > 0) {
|
||||
string referenced_filename = Utilities.FromMSBuildPath (
|
||||
string referenced_filename = MSBuildUtils.FromMSBuildPath (
|
||||
Path.Combine (basepath, parts [0]).Trim ());
|
||||
if (File.Exists (referenced_filename) &&
|
||||
IsFileNewerThan (referenced_filename, resources_filename))
|
||||
@@ -383,7 +384,7 @@ namespace Microsoft.Build.Tasks {
|
||||
}
|
||||
|
||||
protected override string ToolName {
|
||||
get { return Utilities.RunningOnWindows ? "resgen2.bat" : "resgen2"; }
|
||||
get { return MSBuildUtils.RunningOnWindows ? "resgen2.bat" : "resgen2"; }
|
||||
}
|
||||
|
||||
public string SourceFile { get; set; }
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace Microsoft.Build.Tasks {
|
||||
|
||||
protected override string ToolName {
|
||||
get {
|
||||
return Utilities.RunningOnWindows ? "lc.bat" : "lc";
|
||||
return MSBuildUtils.RunningOnWindows ? "lc.bat" : "lc";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,6 @@ namespace Microsoft.Build.Tasks {
|
||||
Hashtable outputs;
|
||||
|
||||
var global_properties = SplitPropertiesToDictionary ();
|
||||
Dictionary<string, ITaskItem> projectsByFileName = new Dictionary<string, ITaskItem> ();
|
||||
|
||||
Log.LogMessage (MessageImportance.Low, "Global Properties:");
|
||||
if (global_properties != null)
|
||||
@@ -104,11 +103,6 @@ namespace Microsoft.Build.Tasks {
|
||||
}
|
||||
|
||||
if (result) {
|
||||
// Metadata from the first item for the project file is copied
|
||||
ITaskItem first_item;
|
||||
if (!projectsByFileName.TryGetValue (filename, out first_item))
|
||||
projectsByFileName [filename] = first_item = project;
|
||||
|
||||
foreach (DictionaryEntry de in outputs) {
|
||||
ITaskItem [] array = (ITaskItem []) de.Value;
|
||||
foreach (ITaskItem item in array) {
|
||||
@@ -117,7 +111,7 @@ namespace Microsoft.Build.Tasks {
|
||||
|
||||
// copy the metadata from original @project to here
|
||||
// CopyMetadataTo does _not_ overwrite
|
||||
first_item.CopyMetadataTo (new_item);
|
||||
project.CopyMetadataTo (new_item);
|
||||
|
||||
outputItems.Add (new_item);
|
||||
|
||||
|
||||
@@ -355,7 +355,7 @@ namespace Mono.PkgConfig
|
||||
// For mac osx, look in the 'External' dir on macosx,
|
||||
// see bug #663180
|
||||
string pkgConfigPath = String.Format ("{0}:{1}",
|
||||
Microsoft.Build.Tasks.Utilities.RunningOnMac ? MacOSXExternalPkgConfigDir : String.Empty,
|
||||
Mono.XBuild.Utilities.MSBuildUtils.RunningOnMac ? MacOSXExternalPkgConfigDir : String.Empty,
|
||||
Environment.GetEnvironmentVariable ("PKG_CONFIG_PATH") ?? String.Empty);
|
||||
|
||||
string pkgConfigDir = Environment.GetEnvironmentVariable ("PKG_CONFIG_LIBDIR");
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
using System;
|
||||
using Microsoft.Build.Framework;
|
||||
using Microsoft.Build.Tasks;
|
||||
using Mono.XBuild.Utilities;
|
||||
|
||||
namespace Microsoft.Build.Tasks {
|
||||
public class SGen : ToolTaskExtension {
|
||||
@@ -115,7 +116,7 @@ namespace Microsoft.Build.Tasks {
|
||||
|
||||
[MonoTODO]
|
||||
protected override string ToolName {
|
||||
get { return Utilities.RunningOnWindows ? "sgen.bat" : "sgen"; }
|
||||
get { return MSBuildUtils.RunningOnWindows ? "sgen.bat" : "sgen"; }
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
|
||||
@@ -35,6 +35,7 @@ using System.Text.RegularExpressions;
|
||||
|
||||
using Microsoft.Build.Framework;
|
||||
using Microsoft.Build.Utilities;
|
||||
using Mono.XBuild.Utilities;
|
||||
|
||||
namespace Microsoft.Build.Tasks {
|
||||
|
||||
@@ -303,7 +304,7 @@ namespace Microsoft.Build.Tasks {
|
||||
|
||||
[MonoTODO]
|
||||
protected override string ToolName {
|
||||
get { return Utilities.RunningOnWindows ? "vbnc.bat" : "vbnc"; }
|
||||
get { return MSBuildUtils.RunningOnWindows ? "vbnc.bat" : "vbnc"; }
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
|
||||
@@ -115,6 +115,53 @@ namespace MonoTests.Microsoft.Build.Tasks
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestLink ()
|
||||
{
|
||||
string projectText = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
|
||||
<ItemGroup>
|
||||
<FooFiles Include=""xyz.cs"">
|
||||
<Child>Cxyz.cs</Child>
|
||||
<Link>Test\Link\xyz.cs</Link>
|
||||
</FooFiles>
|
||||
<FooFiles Include=""rel\bar.resx"">
|
||||
<Child>Crel\bar.resx</Child>
|
||||
<Link>Test\Link\bar.resx</Link>
|
||||
</FooFiles>
|
||||
<FooFiles Include=""rel\qwe.txt"">
|
||||
<Child>Crel\qwe.txt</Child>
|
||||
<Link>..\Test\Link\qwe.txt</Link>
|
||||
</FooFiles>
|
||||
</ItemGroup>
|
||||
<Target Name=""1"">
|
||||
<AssignTargetPath Files=""@(FooFiles)"" RootFolder=""/"">
|
||||
<Output TaskParameter=""AssignedFiles"" ItemName=""FooPath"" />
|
||||
</AssignTargetPath>
|
||||
</Target>
|
||||
</Project>";
|
||||
Engine engine = new Engine(Consts.BinPath);
|
||||
Project project = engine.CreateNewProject();
|
||||
|
||||
project.LoadXml(projectText);
|
||||
|
||||
string id = "A";
|
||||
Assert.IsTrue(project.Build("1"), id + "1 : Error in building");
|
||||
|
||||
string [] files = new string [] { "xyz.cs", "rel/bar.resx", "rel/qwe.txt"};
|
||||
string [] assignedFiles = new string [] { "Test/Link/xyz.cs", "Test/Link/bar.resx", "../Test/Link/qwe.txt"};
|
||||
|
||||
BuildItemGroup include = project.GetEvaluatedItemsByName("FooPath");
|
||||
Assert.AreEqual(files.Length, include.Count, id + "2");
|
||||
|
||||
for (int i = 0; i < files.Length; i++) {
|
||||
Assert.AreEqual (files [i], include [i].FinalItemSpec, id + "3, file #" + i);
|
||||
Assert.IsTrue (include[i].HasMetadata ("TargetPath"), id + "4, file #" + i + ", TargetPath metadata missing");
|
||||
Assert.AreEqual (assignedFiles [i], include[i].GetMetadata("TargetPath"), id + "5, file #" + i);
|
||||
Assert.IsTrue (include [i].HasMetadata ("Child"), id + "6, file #" + i + ", Child metadata missing");
|
||||
Assert.AreEqual ("C" + files [i], include [i].GetMetadata ("Child"), id + "7, file #" + i + ", Child metadata value incorrect");
|
||||
}
|
||||
}
|
||||
|
||||
void CheckTargetPath(string[] files, string[] assignedFiles, string rootFolder, string id)
|
||||
{
|
||||
Engine engine = new Engine(Consts.BinPath);
|
||||
|
||||
@@ -17,4 +17,5 @@ Microsoft.Build.Utilities/ToolLocationHelper.cs
|
||||
Microsoft.Build.Utilities/ToolTask.cs
|
||||
Mono.XBuild.Utilities/MonoLocationHelper.cs
|
||||
Mono.XBuild.Utilities/ReservedNameUtils.cs
|
||||
Mono.XBuild.Utilities/MSBuildUtils.cs
|
||||
../System/System.Collections.Specialized/ProcessStringDictionary.cs
|
||||
+122
-25
@@ -28,19 +28,97 @@
|
||||
#if NET_2_0
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Microsoft.Build.Tasks {
|
||||
internal static class Utilities {
|
||||
namespace Mono.XBuild.Utilities {
|
||||
internal static class MSBuildUtils {
|
||||
|
||||
public readonly static bool RunningOnMac;
|
||||
public readonly static bool RunningOnWindows;
|
||||
static Hashtable charsToEscape;
|
||||
|
||||
static Utilities ()
|
||||
static MSBuildUtils ()
|
||||
{
|
||||
RunningOnWindows = Path.DirectorySeparatorChar == '\\';
|
||||
RunningOnMac = !RunningOnWindows && IsRunningOnMac ();
|
||||
|
||||
charsToEscape = new Hashtable ();
|
||||
|
||||
charsToEscape.Add ('$', null);
|
||||
charsToEscape.Add ('%', null);
|
||||
charsToEscape.Add ('\'', null);
|
||||
charsToEscape.Add ('(', null);
|
||||
charsToEscape.Add (')', null);
|
||||
charsToEscape.Add ('*', null);
|
||||
charsToEscape.Add (';', null);
|
||||
charsToEscape.Add ('?', null);
|
||||
charsToEscape.Add ('@', null);
|
||||
}
|
||||
|
||||
public static string Escape (string unescapedExpression)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
|
||||
foreach (char c in unescapedExpression) {
|
||||
if (charsToEscape.Contains (c))
|
||||
sb.AppendFormat ("%{0:x2}", (int) c);
|
||||
else
|
||||
sb.Append (c);
|
||||
}
|
||||
|
||||
return sb.ToString ();
|
||||
}
|
||||
|
||||
// FIXME: add tests for this
|
||||
internal static string Unescape (string escapedExpression)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
|
||||
int i = 0;
|
||||
while (i < escapedExpression.Length) {
|
||||
sb.Append (Uri.HexUnescape (escapedExpression, ref i));
|
||||
}
|
||||
|
||||
return sb.ToString ();
|
||||
}
|
||||
|
||||
internal static string UnescapeFromXml (string text)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
for (int i = 0; i < text.Length; i++) {
|
||||
char c1 = text[i];
|
||||
if (c1 == '&') {
|
||||
int end = text.IndexOf (';', i);
|
||||
if (end == -1)
|
||||
throw new FormatException ("Unterminated XML entity.");
|
||||
string entity = text.Substring (i+1, end - i - 1);
|
||||
switch (entity) {
|
||||
case "lt":
|
||||
sb.Append ('<');
|
||||
break;
|
||||
case "gt":
|
||||
sb.Append ('>');
|
||||
break;
|
||||
case "amp":
|
||||
sb.Append ('&');
|
||||
break;
|
||||
case "apos":
|
||||
sb.Append ('\'');
|
||||
break;
|
||||
case "quot":
|
||||
sb.Append ('"');
|
||||
break;
|
||||
default:
|
||||
throw new FormatException ("Unrecogised XML entity '&" + entity + ";'.");
|
||||
}
|
||||
i = end;
|
||||
} else
|
||||
sb.Append (c1);
|
||||
}
|
||||
return sb.ToString ();
|
||||
}
|
||||
|
||||
[DllImport ("libc")]
|
||||
@@ -68,42 +146,60 @@ namespace Microsoft.Build.Tasks {
|
||||
|
||||
internal static string FromMSBuildPath (string relPath)
|
||||
{
|
||||
if (relPath == null || relPath.Length == 0)
|
||||
return null;
|
||||
string result = null;
|
||||
FromMSBuildPath (String.Empty, relPath, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
bool is_windows = Path.DirectorySeparatorChar == '\\';
|
||||
internal static bool FromMSBuildPath (string basePath, string relPath, out string resultPath)
|
||||
{
|
||||
resultPath = relPath;
|
||||
|
||||
if (string.IsNullOrEmpty (relPath))
|
||||
return false;
|
||||
|
||||
string path = relPath;
|
||||
if (!is_windows)
|
||||
if (!RunningOnWindows)
|
||||
path = path.Replace ("\\", "/");
|
||||
|
||||
path = Unescape (path);
|
||||
|
||||
// a path with drive letter is invalid/unusable on non-windows
|
||||
if (!is_windows && char.IsLetter (path [0]) && path.Length > 1 && path[1] == ':')
|
||||
return null;
|
||||
|
||||
if (System.IO.File.Exists (path)){
|
||||
return Path.GetFullPath (path);
|
||||
if (char.IsLetter (path [0]) && path.Length > 1 && path[1] == ':') {
|
||||
if (RunningOnWindows) {
|
||||
resultPath = path; // Return the escaped value
|
||||
return true;
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Path.IsPathRooted (path)) {
|
||||
|
||||
|
||||
if (basePath != null)
|
||||
path = Path.Combine (basePath, path);
|
||||
|
||||
if (System.IO.File.Exists (path) || System.IO.Directory.Exists (path)){
|
||||
resultPath = Path.GetFullPath (path);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Path.IsPathRooted (path) && !RunningOnWindows) {
|
||||
|
||||
// Windows paths are case-insensitive. When mapping an absolute path
|
||||
// we can try to find the correct case for the path.
|
||||
|
||||
|
||||
string[] names = path.Substring (1).Split ('/');
|
||||
string part = "/";
|
||||
|
||||
|
||||
for (int n=0; n<names.Length; n++) {
|
||||
string[] entries;
|
||||
|
||||
if (names [n] == ".."){
|
||||
if (part == "/")
|
||||
return ""; // Can go further back. It's not an existing file
|
||||
return false; // Can go further back. It's not an existing file
|
||||
part = Path.GetFullPath (part + "/..");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
entries = Directory.GetFileSystemEntries (part);
|
||||
|
||||
|
||||
string fpath = null;
|
||||
foreach (string e in entries) {
|
||||
if (string.Compare (Path.GetFileName (e), names[n], true) == 0) {
|
||||
@@ -116,17 +212,18 @@ namespace Microsoft.Build.Tasks {
|
||||
part = Path.GetFullPath (part);
|
||||
for (; n < names.Length; n++)
|
||||
part += "/" + names[n];
|
||||
return part;
|
||||
resultPath = part;
|
||||
return true;
|
||||
}
|
||||
|
||||
part = fpath;
|
||||
}
|
||||
return Path.GetFullPath (part);
|
||||
resultPath = Path.GetFullPath (part);
|
||||
} else {
|
||||
return Path.GetFullPath (path);
|
||||
resultPath = Path.GetFullPath (path);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -69,7 +69,7 @@ namespace Microsoft.CSharp.RuntimeBinder
|
||||
{
|
||||
Expression res;
|
||||
try {
|
||||
var rc = new Compiler.ResolveContext (new RuntimeBinderContext (ctx, ctx.ImportType (callingType)), ResolveOptions);
|
||||
var rc = new Compiler.ResolveContext (new RuntimeBinderContext (ctx, callingType), ResolveOptions);
|
||||
|
||||
// Static typemanager and internal caches are not thread-safe
|
||||
lock (resolver) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// RuntimeBinderContext.cs
|
||||
//
|
||||
// Authors:
|
||||
@@ -35,18 +35,39 @@ namespace Microsoft.CSharp.RuntimeBinder
|
||||
class RuntimeBinderContext : Compiler.IMemberContext
|
||||
{
|
||||
readonly Compiler.ModuleContainer module;
|
||||
readonly Compiler.TypeSpec currentType;
|
||||
readonly Type callingType;
|
||||
readonly DynamicContext ctx;
|
||||
Compiler.TypeSpec callingTypeImported;
|
||||
|
||||
public RuntimeBinderContext (DynamicContext ctx, Compiler.TypeSpec currentType)
|
||||
public RuntimeBinderContext (DynamicContext ctx, Compiler.TypeSpec callingType)
|
||||
{
|
||||
this.ctx = ctx;
|
||||
this.module = ctx.Module;
|
||||
this.currentType = currentType;
|
||||
this.callingTypeImported = callingType;
|
||||
}
|
||||
|
||||
public RuntimeBinderContext (DynamicContext ctx, Type callingType)
|
||||
{
|
||||
this.ctx = ctx;
|
||||
this.module = ctx.Module;
|
||||
this.callingType = callingType;
|
||||
}
|
||||
|
||||
#region IMemberContext Members
|
||||
|
||||
public Compiler.TypeSpec CurrentType {
|
||||
get { return currentType; }
|
||||
get {
|
||||
//
|
||||
// Delay importing of calling type to be compatible with .net
|
||||
// Some libraries are setting it to null which is invalid
|
||||
// but the NullReferenceException is thrown only when the context
|
||||
// is used and not during initialization
|
||||
//
|
||||
if (callingTypeImported == null && callingType != null)
|
||||
callingTypeImported = ctx.ImportType (callingType);
|
||||
|
||||
return callingTypeImported;
|
||||
}
|
||||
}
|
||||
|
||||
public Compiler.TypeParameter[] CurrentTypeParameters {
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// AssemblyInfo.cs
|
||||
//
|
||||
// Author:
|
||||
// Marek Habersack <[email protected]>
|
||||
//
|
||||
// Copyright (c) 2011 Novell, Inc (http://novell.com/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
using System.Security;
|
||||
|
||||
[assembly: AssemblyProduct ("ASP.Net WebPages")]
|
||||
[assembly: AssemblyCompany ("Novell, Inc")]
|
||||
[assembly: AssemblyCopyright ("© Novell, Inc. All rights reserved.")]
|
||||
[assembly: AssemblyConfiguration ("")]
|
||||
[assembly: RuntimeCompatibility (WrapNonExceptionThrows=true)]
|
||||
[assembly: AssemblyTrademark ("")]
|
||||
[assembly: NeutralResourcesLanguage ("en-US")]
|
||||
[assembly: Debuggable (DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
|
||||
[assembly: CLSCompliant (true)]
|
||||
[assembly: ComVisible (false)]
|
||||
[assembly: AssemblyFileVersion ("1.0.20105.407")]
|
||||
[assembly: AssemblyVersion ("1.0.0.0")]
|
||||
[assembly: TargetFramework (".NETFramework,Version=v4.0", FrameworkDisplayName=".NET Framework 4")]
|
||||
[assembly: AllowPartiallyTrustedCallers]
|
||||
[assembly: CompilationRelaxations (8)]
|
||||
[assembly: AssemblyTitle ("Microsoft.Web.Infrastructure")]
|
||||
[assembly: AssemblyDescription ("")]
|
||||
[assembly: AssemblyDelaySign (true)]
|
||||
[assembly: AssemblyKeyFile("../winfx.pub")]
|
||||
@@ -0,0 +1,20 @@
|
||||
thisdir = class/Microsoft.Web.Infrastructure
|
||||
SUBDIRS =
|
||||
include ../../build/rules.make
|
||||
|
||||
LIBRARY = Microsoft.Web.Infrastructure.dll
|
||||
LIB_MCS_FLAGS = -r:System.dll \
|
||||
-r:System.Configuration.dll \
|
||||
-r:System.Web.dll
|
||||
|
||||
EXTRA_DISTFILES = $(RESOURCE_FILES)
|
||||
|
||||
VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
|
||||
ifndef VALID_PROFILE
|
||||
LIBRARY_NAME = dummy-Microsoft.Web.Infrastructure.dll
|
||||
NO_INSTALL = yes
|
||||
NO_SIGN_ASSEMBLY = yes
|
||||
NO_TEST = yes
|
||||
endif
|
||||
|
||||
include ../../build/library.make
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// DynamicModuleUtility.cs
|
||||
//
|
||||
// Author:
|
||||
// Marek Habersack <[email protected]>
|
||||
//
|
||||
// Copyright (c) 2011 Novell, Inc (http://novell.com/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using Microsoft.Web.Infrastructure.DynamicModuleHelper;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Security;
|
||||
using System.Web;
|
||||
using System.Web.Configuration;
|
||||
|
||||
namespace Microsoft.Web.Infrastructure.DynamicModuleHelper
|
||||
{
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
public static class DynamicModuleUtility
|
||||
{
|
||||
[SecuritySafeCritical]
|
||||
public static void RegisterModule (Type moduleType)
|
||||
{
|
||||
if (moduleType == null)
|
||||
return;
|
||||
|
||||
string typeName = moduleType.AssemblyQualifiedName;
|
||||
var cfg = WebConfigurationManager.GetWebApplicationSection ("system.web/httpModules") as HttpModulesSection;
|
||||
cfg.Modules.Add (new HttpModuleAction ("__Dynamic_Module_" + typeName, typeName));
|
||||
}
|
||||
}
|
||||
}
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
//
|
||||
// Author:
|
||||
// Marek Habersack <[email protected]>
|
||||
//
|
||||
// Copyright (c) 2011 Novell, Inc (http://novell.com/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using System.Web;
|
||||
using System.Web.Util;
|
||||
|
||||
namespace Microsoft.Web.Infrastructure.DynamicValidationHelper
|
||||
{
|
||||
sealed class LazyWebROCollection : WebROCollection
|
||||
{
|
||||
WebROCollection wrapped;
|
||||
RequestValidationSource validationSource;
|
||||
|
||||
public LazyWebROCollection (RequestValidationSource validationSource, WebROCollection wrapped)
|
||||
{
|
||||
if (wrapped == null)
|
||||
throw new ArgumentNullException ("wrapped");
|
||||
|
||||
this.validationSource = validationSource;
|
||||
this.wrapped = wrapped;
|
||||
}
|
||||
|
||||
public string this [int index] {
|
||||
get { return Get (index); }
|
||||
}
|
||||
|
||||
public string this [string name] {
|
||||
get { return Get (name); }
|
||||
set{ Set (name,value); }
|
||||
}
|
||||
|
||||
public override string Get (string name)
|
||||
{
|
||||
return Validate (name, wrapped.Get (name));
|
||||
}
|
||||
|
||||
public override string Get (int index)
|
||||
{
|
||||
return Validate (wrapped.GetKey (index), wrapped.Get (index));
|
||||
}
|
||||
|
||||
public override IEnumerator GetEnumerator ()
|
||||
{
|
||||
return wrapped.GetEnumerator ();
|
||||
}
|
||||
|
||||
public override string GetKey (int index)
|
||||
{
|
||||
return wrapped.GetKey (index);
|
||||
}
|
||||
|
||||
public override string[] GetValues (int index)
|
||||
{
|
||||
return wrapped.GetValues (index);
|
||||
}
|
||||
|
||||
public override string[] GetValues (string name)
|
||||
{
|
||||
return wrapped.GetValues (name);
|
||||
}
|
||||
|
||||
string Validate (string key, string value)
|
||||
{
|
||||
if (String.IsNullOrEmpty (value))
|
||||
return value;
|
||||
|
||||
HttpRequest.ValidateString (key, value, validationSource);
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
//
|
||||
// ValidationUtility.cs
|
||||
//
|
||||
// Author:
|
||||
// Marek Habersack <[email protected]>
|
||||
//
|
||||
// Copyright (c) 2011 Novell, Inc (http://novell.com/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.Security;
|
||||
using System.Web;
|
||||
using System.Web.Util;
|
||||
|
||||
namespace Microsoft.Web.Infrastructure.DynamicValidationHelper
|
||||
{
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
public static class ValidationUtility
|
||||
{
|
||||
[SecuritySafeCritical]
|
||||
public static void EnableDynamicValidation (HttpContext context)
|
||||
{
|
||||
HttpRequest req = context != null ? context.Request : null;
|
||||
if (req == null)
|
||||
return;
|
||||
|
||||
// Just to be safe, make sure it's on
|
||||
req.ValidateInput ();
|
||||
req.SetFormCollection (new LazyWebROCollection (RequestValidationSource.Form, req.FormUnvalidated), true);
|
||||
req.SetQueryStringCollection (new LazyWebROCollection (RequestValidationSource.QueryString, req.QueryStringUnvalidated), true);
|
||||
}
|
||||
|
||||
[SecuritySafeCritical]
|
||||
public static bool? IsValidationEnabled (HttpContext context)
|
||||
{
|
||||
HttpRequest req = context != null ? context.Request : null;
|
||||
if (req == null)
|
||||
return true;
|
||||
|
||||
return req.InputValidationEnabled;
|
||||
}
|
||||
|
||||
[SecuritySafeCritical]
|
||||
public static void GetUnvalidatedCollections (HttpContext context, out Func <NameValueCollection> formGetter, out Func <NameValueCollection> queryStringGetter)
|
||||
{
|
||||
if (context == null)
|
||||
throw new ArgumentNullException ("context");
|
||||
formGetter = null;
|
||||
queryStringGetter = null;
|
||||
|
||||
formGetter = () => {
|
||||
HttpRequest req = context != null ? context.Request : null;
|
||||
if (req == null)
|
||||
return null;
|
||||
return req.FormUnvalidated;
|
||||
};
|
||||
|
||||
queryStringGetter = () => {
|
||||
HttpRequest req = context != null ? context.Request : null;
|
||||
if (req == null)
|
||||
return null;
|
||||
return req.QueryStringUnvalidated;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
../../build/common/Consts.cs
|
||||
../../build/common/Locale.cs
|
||||
../../build/common/MonoTODOAttribute.cs
|
||||
|
||||
./Assembly/AssemblyInfo.cs
|
||||
./Microsoft.Web.Infrastructure.DynamicModuleHelper/DynamicModuleUtility.cs
|
||||
./Microsoft.Web.Infrastructure.DynamicValidationHelper/ValidationUtility.cs
|
||||
./Microsoft.Web.Infrastructure.DynamicValidationHelper/LazyWebROCollection.cs
|
||||
./Microsoft.Web.Infrastructure/HttpContextHelper.cs
|
||||
./Microsoft.Web.Infrastructure/InfrastructureHelper.cs
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// HttpContextHelper.cs
|
||||
//
|
||||
// Author:
|
||||
// Marek Habersack <[email protected]>
|
||||
//
|
||||
// Copyright (c) 2011 Novell, Inc (http://novell.com/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using Microsoft.Web.Infrastructure;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Security;
|
||||
using System.Web;
|
||||
|
||||
namespace Microsoft.Web.Infrastructure
|
||||
{
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
public static class HttpContextHelper
|
||||
{
|
||||
[SecuritySafeCritical]
|
||||
public static void ExecuteInNullContext (Action action)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// InfrastructureHelper.cs
|
||||
//
|
||||
// Author:
|
||||
// Marek Habersack <[email protected]>
|
||||
//
|
||||
// Copyright (c) 2011 Novell, Inc (http://novell.com/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using Microsoft.Web.Infrastructure;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Security;
|
||||
|
||||
namespace Microsoft.Web.Infrastructure
|
||||
{
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
public static class InfrastructureHelper
|
||||
{
|
||||
[SecuritySafeCritical]
|
||||
public static void UnloadAppDomain ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[SecuritySafeCritical]
|
||||
public static bool IsCodeDomDefinedExtension (string extension)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1884,6 +1884,8 @@ namespace Mono.Cecil {
|
||||
|
||||
ReadMethodSignature (signature, call_site);
|
||||
|
||||
call_site.MetadataToken = token;
|
||||
|
||||
return call_site;
|
||||
}
|
||||
|
||||
@@ -2803,10 +2805,11 @@ namespace Mono.Cecil {
|
||||
if (type.IsArray)
|
||||
return ReadCustomAttributeFixedArrayArgument ((ArrayType) type);
|
||||
|
||||
if (type.etype == ElementType.Object)
|
||||
return ReadCustomAttributeElement (ReadCustomAttributeFieldOrPropType ());
|
||||
|
||||
return new CustomAttributeArgument (type, ReadCustomAttributeElementValue (type));
|
||||
return new CustomAttributeArgument (
|
||||
type,
|
||||
type.etype == ElementType.Object
|
||||
? ReadCustomAttributeElement (ReadCustomAttributeFieldOrPropType ())
|
||||
: ReadCustomAttributeElementValue (type));
|
||||
}
|
||||
|
||||
object ReadCustomAttributeElementValue (TypeReference type)
|
||||
|
||||
@@ -2279,8 +2279,11 @@ namespace Mono.Cecil {
|
||||
}
|
||||
|
||||
if (type.etype == ElementType.Object) {
|
||||
WriteCustomAttributeFieldOrPropType (argument.Type);
|
||||
WriteCustomAttributeElement (argument.Type, argument);
|
||||
argument = (CustomAttributeArgument) argument.Value;
|
||||
type = argument.Type;
|
||||
|
||||
WriteCustomAttributeFieldOrPropType (type);
|
||||
WriteCustomAttributeElement (type, argument);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,5 +41,14 @@ namespace Mono.Cecil {
|
||||
return signature.ToString ();
|
||||
}
|
||||
}
|
||||
|
||||
public override ModuleDefinition Module {
|
||||
get { return ReturnType.Module; }
|
||||
}
|
||||
|
||||
public override MethodDefinition Resolve ()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,6 +103,10 @@ namespace Mono.Cecil {
|
||||
get { return constructor.DeclaringType; }
|
||||
}
|
||||
|
||||
public bool IsResolved {
|
||||
get { return resolved; }
|
||||
}
|
||||
|
||||
public bool HasConstructorArguments {
|
||||
get {
|
||||
Resolve ();
|
||||
@@ -195,12 +199,23 @@ namespace Mono.Cecil {
|
||||
if (resolved || !HasImage)
|
||||
return;
|
||||
|
||||
Module.Read (this, (attribute, reader) => {
|
||||
reader.ReadCustomAttributeSignature (attribute);
|
||||
return this;
|
||||
});
|
||||
try {
|
||||
Module.Read (this, (attribute, reader) => {
|
||||
reader.ReadCustomAttributeSignature (attribute);
|
||||
return this;
|
||||
});
|
||||
|
||||
resolved = true;
|
||||
resolved = true;
|
||||
} catch (ResolutionException) {
|
||||
if (arguments != null)
|
||||
arguments.Clear ();
|
||||
if (fields != null)
|
||||
fields.Clear ();
|
||||
if (properties != null)
|
||||
properties.Clear ();
|
||||
|
||||
resolved = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,11 +70,11 @@ namespace Mono.Cecil {
|
||||
get {
|
||||
var signature = new StringBuilder ();
|
||||
var method = this.ElementMethod;
|
||||
signature.Append (method.ReturnType.FullName);
|
||||
signature.Append (" ");
|
||||
signature.Append (method.DeclaringType.FullName);
|
||||
signature.Append ("::");
|
||||
signature.Append (method.Name);
|
||||
signature.Append (method.ReturnType.FullName)
|
||||
.Append (" ")
|
||||
.Append (method.DeclaringType.FullName)
|
||||
.Append ("::")
|
||||
.Append (method.Name);
|
||||
this.GenericInstanceFullName (signature);
|
||||
this.MethodSignatureFullName (signature);
|
||||
return signature.ToString ();
|
||||
|
||||
@@ -41,6 +41,21 @@ namespace Mono.Cecil {
|
||||
AssemblyDefinition Resolve (string fullName, ReaderParameters parameters);
|
||||
}
|
||||
|
||||
public class ResolutionException : Exception {
|
||||
|
||||
readonly MemberReference member;
|
||||
|
||||
public MemberReference Member {
|
||||
get { return member; }
|
||||
}
|
||||
|
||||
public ResolutionException (MemberReference member)
|
||||
: base ("Failed to resolve " + member.FullName)
|
||||
{
|
||||
this.member = member;
|
||||
}
|
||||
}
|
||||
|
||||
static class MetadataResolver {
|
||||
|
||||
public static TypeDefinition Resolve (IAssemblyResolver resolver, TypeReference type)
|
||||
|
||||
@@ -123,9 +123,9 @@ namespace Mono.Cecil {
|
||||
public override string FullName {
|
||||
get {
|
||||
var builder = new StringBuilder ();
|
||||
builder.Append (ReturnType.FullName);
|
||||
builder.Append (" ");
|
||||
builder.Append (MemberFullName ());
|
||||
builder.Append (ReturnType.FullName)
|
||||
.Append (" ")
|
||||
.Append (MemberFullName ());
|
||||
this.MethodSignatureFullName (builder);
|
||||
return builder.ToString ();
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ namespace Mono.Cecil {
|
||||
{
|
||||
var type = self.Resolve ();
|
||||
if (type == null)
|
||||
throw new InvalidOperationException (string.Format ("Failed to resolve type: {0}", self.FullName));
|
||||
throw new ResolutionException (self);
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
a00566b60e5ae888758b0d26dd4fbbb93523bf6f
|
||||
5f427237847cd9acb3bb14317c83f7c67a04ab41
|
||||
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// AssemblyInfo.cs
|
||||
//
|
||||
// Author:
|
||||
// Zoltan Varga ([email protected])
|
||||
//
|
||||
// (C) 2011 Novell (http://www.novell.com)
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Permissions;
|
||||
|
||||
[assembly: AssemblyVersion (Consts.FxVersion)]
|
||||
|
||||
[assembly: AssemblyTitle("Mono.Debugger.Soft.dll")]
|
||||
[assembly: AssemblyDescription("Mono Soft Debugger API library")]
|
||||
@@ -15,14 +15,15 @@ dtest-app.exe: Test/dtest-app.cs
|
||||
$(CSCOMPILE) -out:$@ -unsafe -debug Test/dtest-app.cs
|
||||
|
||||
dtest-excfilter.exe: Test/dtest-excfilter.il
|
||||
$(INTERNAL_ILASM) -out:$@ /exe /debug Test/dtest-excfilter.il
|
||||
MONO_PATH=$(topdir)/class/lib/$(PROFILE) $(INTERNAL_ILASM) -out:$@ /exe /debug Test/dtest-excfilter.il
|
||||
|
||||
CLEAN_FILES = dtest-app.exe dtest-app.exe.mdb
|
||||
CLEAN_FILES = dtest-app.exe dtest-app.exe.mdb dtest-excfilter.exe dtest-excfilter.exe.mdb
|
||||
|
||||
EXTRA_DISTFILES = \
|
||||
Test/dtest-app.cs \
|
||||
Test/dtest.cs \
|
||||
Test/dtest-excfilter.il
|
||||
|
||||
#NO_TEST = yes
|
||||
|
||||
ifneq (net_2_0, $(PROFILE))
|
||||
NO_INSTALL = yes
|
||||
endif
|
||||
|
||||
include ../../build/library.make
|
||||
@@ -1,3 +1,6 @@
|
||||
./Assembly/AssemblyInfo.cs
|
||||
../../build/common/Consts.cs
|
||||
../../build/common/Locale.cs
|
||||
Mono.Debugger.Soft/CustomAttributeTypedArgumentMirror.cs
|
||||
Mono.Debugger.Soft/ExceptionEvent.cs
|
||||
Mono.Debugger.Soft/ModuleMirror.cs
|
||||
|
||||
@@ -21,6 +21,16 @@ namespace Mono.Debugger.Soft
|
||||
public int MinorVersion {
|
||||
get; set;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check that this version is at least major:minor
|
||||
*/
|
||||
public bool AtLeast (int major, int minor) {
|
||||
if ((MajorVersion > major) || ((MajorVersion == major && MinorVersion >= minor)))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class DebugInfo {
|
||||
@@ -308,7 +318,7 @@ namespace Mono.Debugger.Soft
|
||||
* with newer runtimes, and vice versa.
|
||||
*/
|
||||
public const int MAJOR_VERSION = 2;
|
||||
public const int MINOR_VERSION = 2;
|
||||
public const int MINOR_VERSION = 3;
|
||||
|
||||
enum WPSuspendPolicy {
|
||||
NONE = 0,
|
||||
@@ -380,7 +390,9 @@ namespace Mono.Debugger.Soft
|
||||
GET_STATE = 3,
|
||||
GET_INFO = 4,
|
||||
/* FIXME: Merge into GET_INFO when the major protocol version is increased */
|
||||
GET_ID = 5
|
||||
GET_ID = 5,
|
||||
/* Ditto */
|
||||
GET_TID = 6
|
||||
}
|
||||
|
||||
enum CmdEventRequest {
|
||||
@@ -1555,6 +1567,10 @@ namespace Mono.Debugger.Soft
|
||||
return SendReceive (CommandSet.THREAD, (int)CmdThread.GET_ID, new PacketWriter ().WriteId (id)).ReadLong ();
|
||||
}
|
||||
|
||||
public long Thread_GetTID (long id) {
|
||||
return SendReceive (CommandSet.THREAD, (int)CmdThread.GET_TID, new PacketWriter ().WriteId (id)).ReadLong ();
|
||||
}
|
||||
|
||||
/*
|
||||
* MODULE
|
||||
*/
|
||||
|
||||
@@ -105,28 +105,23 @@ namespace Mono.Debugger.Soft
|
||||
instr.Operand = br.ReadByte ();
|
||||
break;
|
||||
case OperandType.ShortInlineVar :
|
||||
br.ReadByte ();
|
||||
//instr.Operand = GetVariable (body, br.ReadByte ());
|
||||
instr.Operand = br.ReadByte ();
|
||||
break;
|
||||
case OperandType.ShortInlineArg :
|
||||
br.ReadByte ();
|
||||
//instr.Operand = GetParameter (body, br.ReadByte ());
|
||||
instr.Operand = br.ReadByte ();
|
||||
break;
|
||||
case OperandType.InlineSig :
|
||||
br.ReadInt32 ();
|
||||
//instr.Operand = GetCallSiteAt (br.ReadInt32 (), context);
|
||||
break;
|
||||
case OperandType.InlineI :
|
||||
br.ReadInt32 ();
|
||||
//instr.Operand = br.ReadInt32 ();
|
||||
instr.Operand = br.ReadInt32 ();
|
||||
break;
|
||||
case OperandType.InlineVar :
|
||||
br.ReadInt16 ();
|
||||
//instr.Operand = GetVariable (body, br.ReadInt16 ());
|
||||
instr.Operand = br.ReadInt16 ();
|
||||
break;
|
||||
case OperandType.InlineArg :
|
||||
br.ReadInt16 ();
|
||||
//instr.Operand = GetParameter (body, br.ReadInt16 ());
|
||||
instr.Operand = br.ReadInt16 ();
|
||||
break;
|
||||
case OperandType.InlineI8 :
|
||||
instr.Operand = br.ReadInt64 ();
|
||||
|
||||
@@ -61,5 +61,15 @@ namespace Mono.Debugger.Soft
|
||||
return vm.conn.Thread_GetId (id);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the system thread id (TID) for this thread, this id is not unique since
|
||||
* a newly started thread might reuse a dead thread's id.
|
||||
*/
|
||||
public long TID {
|
||||
get {
|
||||
return vm.conn.Thread_GetTID (id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,6 +74,11 @@ namespace Mono.Debugger.Soft
|
||||
EventSet current_es;
|
||||
int current_es_index;
|
||||
|
||||
/*
|
||||
* It is impossible to determine when to resume when using this method, since
|
||||
* the debuggee is suspended only once per event-set, not event.
|
||||
*/
|
||||
[Obsolete ("Use GetNextEventSet () instead")]
|
||||
public Event GetNextEvent () {
|
||||
lock (queue_monitor) {
|
||||
if (current_es == null || current_es_index == current_es.Events.Length) {
|
||||
@@ -102,6 +107,7 @@ namespace Mono.Debugger.Soft
|
||||
}
|
||||
}
|
||||
|
||||
[Obsolete ("Use GetNextEventSet () instead")]
|
||||
public T GetNextEvent<T> () where T : Event {
|
||||
return GetNextEvent () as T;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,12 @@ public class DebuggerTests
|
||||
public static string runtime = Environment.GetEnvironmentVariable ("DBG_RUNTIME");
|
||||
public static string agent_args = Environment.GetEnvironmentVariable ("DBG_AGENT_ARGS");
|
||||
|
||||
Event GetNextEvent () {
|
||||
var es = vm.GetNextEventSet ();
|
||||
Assert.AreEqual (1, es.Events.Length);
|
||||
return es [0];
|
||||
}
|
||||
|
||||
void Start (string[] args) {
|
||||
if (!listening) {
|
||||
var pi = new Diag.ProcessStartInfo ();
|
||||
@@ -54,7 +60,7 @@ public class DebuggerTests
|
||||
var load_req = vm.CreateAssemblyLoadRequest ();
|
||||
load_req.Enable ();
|
||||
|
||||
Event vmstart = vm.GetNextEvent ();
|
||||
Event vmstart = GetNextEvent ();
|
||||
Assert.AreEqual (EventType.VMStart, vmstart.EventType);
|
||||
|
||||
vm.Resume ();
|
||||
@@ -66,7 +72,7 @@ public class DebuggerTests
|
||||
|
||||
/* Find out the entry point */
|
||||
while (true) {
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
|
||||
if (e is AssemblyLoadEvent) {
|
||||
AssemblyLoadEvent ae = (AssemblyLoadEvent)e;
|
||||
@@ -91,7 +97,7 @@ public class DebuggerTests
|
||||
|
||||
while (true) {
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
if (e is BreakpointEvent)
|
||||
break;
|
||||
}
|
||||
@@ -107,7 +113,7 @@ public class DebuggerTests
|
||||
req.Enable ();
|
||||
|
||||
vm.Resume ();
|
||||
Event e = vm.GetNextEvent ();
|
||||
Event e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
|
||||
req.Disable ();
|
||||
@@ -155,7 +161,7 @@ public class DebuggerTests
|
||||
|
||||
vm.Resume ();
|
||||
while (true) {
|
||||
Event e = vm.GetNextEvent ();
|
||||
Event e = GetNextEvent ();
|
||||
|
||||
if (e is VMDeathEvent)
|
||||
break;
|
||||
@@ -175,7 +181,7 @@ public class DebuggerTests
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.AreEqual (EventType.Breakpoint, e.EventType);
|
||||
Assert.IsTrue (e is BreakpointEvent);
|
||||
Assert.AreEqual (m.Name, (e as BreakpointEvent).Method.Name);
|
||||
@@ -189,8 +195,6 @@ public class DebuggerTests
|
||||
|
||||
[Test]
|
||||
public void BreakpointsSameLocation () {
|
||||
Event e;
|
||||
|
||||
MethodMirror m = entry_point.DeclaringType.GetMethod ("bp2");
|
||||
Assert.IsNotNull (m);
|
||||
|
||||
@@ -199,13 +203,13 @@ public class DebuggerTests
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
Assert.IsTrue (e is BreakpointEvent);
|
||||
Assert.AreEqual (m, (e as BreakpointEvent).Method);
|
||||
var es = vm.GetNextEventSet ();
|
||||
Assert.AreEqual (2, es.Events.Length);
|
||||
Assert.IsTrue (es [0] is BreakpointEvent);
|
||||
Assert.AreEqual (m, (es [0] as BreakpointEvent).Method);
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
Assert.IsTrue (e is BreakpointEvent);
|
||||
Assert.AreEqual (m.Name, (e as BreakpointEvent).Method.Name);
|
||||
Assert.IsTrue (es [1] is BreakpointEvent);
|
||||
Assert.AreEqual (m.Name, (es [1] as BreakpointEvent).Method.Name);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -224,21 +228,21 @@ public class DebuggerTests
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.AreEqual (EventType.Breakpoint, e.EventType);
|
||||
Assert.AreEqual (m.Name, (e as BreakpointEvent).Method.Name);
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
/* Non-shared instance */
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.AreEqual (EventType.Breakpoint, e.EventType);
|
||||
Assert.AreEqual (m2.Name, (e as BreakpointEvent).Method.Name);
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
/* Shared instance */
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.AreEqual (EventType.Breakpoint, e.EventType);
|
||||
Assert.AreEqual (m2.Name, (e as BreakpointEvent).Method.Name);
|
||||
}
|
||||
@@ -259,19 +263,19 @@ public class DebuggerTests
|
||||
/* Run until bp4 */
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
Assert.AreEqual (EventType.Breakpoint, e.EventType);
|
||||
Assert.AreEqual (m.Name, (e as BreakpointEvent).Method.Name);
|
||||
e = vm.GetNextEvent ();
|
||||
Assert.AreEqual (EventType.Breakpoint, e.EventType);
|
||||
Assert.AreEqual (m.Name, (e as BreakpointEvent).Method.Name);
|
||||
var es = vm.GetNextEventSet ();
|
||||
Assert.AreEqual (2, es.Events.Length);
|
||||
Assert.AreEqual (EventType.Breakpoint, es [0].EventType);
|
||||
Assert.AreEqual (m.Name, (es [0] as BreakpointEvent).Method.Name);
|
||||
Assert.AreEqual (EventType.Breakpoint, es [1].EventType);
|
||||
Assert.AreEqual (m.Name, (es [1] as BreakpointEvent).Method.Name);
|
||||
|
||||
/* Clear one of them */
|
||||
req1.Disable ();
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.AreEqual (EventType.Breakpoint, e.EventType);
|
||||
Assert.AreEqual (m.Name, (e as BreakpointEvent).Method.Name);
|
||||
|
||||
@@ -280,7 +284,7 @@ public class DebuggerTests
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.AreEqual (EventType.Breakpoint, e.EventType);
|
||||
Assert.AreEqual (m2.Name, (e as BreakpointEvent).Method.Name);
|
||||
}
|
||||
@@ -301,7 +305,7 @@ public class DebuggerTests
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (!(e is BreakpointEvent));
|
||||
if (e is VMDeathEvent)
|
||||
vm = null;
|
||||
@@ -318,7 +322,7 @@ public class DebuggerTests
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.AreEqual (EventType.Breakpoint, e.EventType);
|
||||
Assert.IsTrue (e is BreakpointEvent);
|
||||
Assert.AreEqual (m.Name, (e as BreakpointEvent).Method.Name);
|
||||
@@ -335,13 +339,13 @@ public class DebuggerTests
|
||||
|
||||
// Step into ss1
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
Assert.AreEqual ("ss1", (e as StepEvent).Method.Name);
|
||||
|
||||
// Step out of ss1
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
Assert.AreEqual ("single_stepping", (e as StepEvent).Method.Name);
|
||||
|
||||
@@ -352,7 +356,7 @@ public class DebuggerTests
|
||||
|
||||
// Step over ss2
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
Assert.AreEqual ("single_stepping", (e as StepEvent).Method.Name);
|
||||
|
||||
@@ -363,7 +367,7 @@ public class DebuggerTests
|
||||
|
||||
// Step into ss3
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
Assert.AreEqual ("ss3", (e as StepEvent).Method.Name);
|
||||
|
||||
@@ -374,7 +378,7 @@ public class DebuggerTests
|
||||
|
||||
// Step back into single_stepping
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
Assert.AreEqual ("single_stepping", (e as StepEvent).Method.Name);
|
||||
|
||||
@@ -385,7 +389,7 @@ public class DebuggerTests
|
||||
|
||||
// Step into ss3_2 ()
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
Assert.AreEqual ("ss3_2", (e as StepEvent).Method.Name);
|
||||
|
||||
@@ -396,7 +400,7 @@ public class DebuggerTests
|
||||
|
||||
// Step over ss3_2_2 ()
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
Assert.AreEqual ("ss3_2", (e as StepEvent).Method.Name);
|
||||
|
||||
@@ -406,7 +410,7 @@ public class DebuggerTests
|
||||
|
||||
// Step back into single_stepping () with the new request
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
Assert.AreEqual ("single_stepping", (e as StepEvent).Method.Name);
|
||||
|
||||
@@ -417,7 +421,7 @@ public class DebuggerTests
|
||||
|
||||
// Step into ss4 ()
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
Assert.AreEqual ("ss4", (e as StepEvent).Method.Name);
|
||||
|
||||
@@ -429,7 +433,7 @@ public class DebuggerTests
|
||||
|
||||
// Step over ss1 (); ss1 ();
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
|
||||
// Step into ss2 ()
|
||||
@@ -438,7 +442,7 @@ public class DebuggerTests
|
||||
req.Enable ();
|
||||
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
Assert.AreEqual ("ss2", (e as StepEvent).Method.Name);
|
||||
|
||||
@@ -453,7 +457,7 @@ public class DebuggerTests
|
||||
|
||||
// Step into is_even, skipping the linq stuff
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
Assert.AreEqual ("is_even", (e as StepEvent).Method.Name);
|
||||
|
||||
@@ -470,10 +474,10 @@ public class DebuggerTests
|
||||
|
||||
// Check that single stepping works in out-of-line bblocks
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
Assert.AreEqual ("ss6", (e as StepEvent).Method.Name);
|
||||
|
||||
@@ -491,12 +495,12 @@ public class DebuggerTests
|
||||
req2.Enable ();
|
||||
|
||||
vm.Resume ();
|
||||
Event e = vm.GetNextEvent ();
|
||||
Event e = GetNextEvent ();
|
||||
Assert.IsTrue (e is MethodEntryEvent);
|
||||
Assert.AreEqual ("ss1", (e as MethodEntryEvent).Method.Name);
|
||||
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is MethodExitEvent);
|
||||
Assert.AreEqual ("ss1", (e as MethodExitEvent).Method.Name);
|
||||
|
||||
@@ -518,13 +522,13 @@ public class DebuggerTests
|
||||
|
||||
// Enter ss2, ss1 is skipped
|
||||
vm.Resume ();
|
||||
Event e = vm.GetNextEvent ();
|
||||
Event e = GetNextEvent ();
|
||||
Assert.IsTrue (e is MethodEntryEvent);
|
||||
Assert.AreEqual ("ss2", (e as MethodEntryEvent).Method.Name);
|
||||
|
||||
// Breakpoint on ss3, the entry event is no longer reported
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is BreakpointEvent);
|
||||
|
||||
req1.Disable ();
|
||||
@@ -1375,13 +1379,13 @@ public class DebuggerTests
|
||||
req.Enable ();
|
||||
|
||||
vm.Resume ();
|
||||
var e = vm.GetNextEvent ();
|
||||
var e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
Assert.AreEqual ("locals2", (e as StepEvent).Method.Name);
|
||||
|
||||
// Execute s = "AB";
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
Assert.AreEqual ("locals2", (e as StepEvent).Method.Name);
|
||||
|
||||
@@ -1441,7 +1445,7 @@ public class DebuggerTests
|
||||
|
||||
// invalid stack frames
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
Assert.AreEqual ("locals2", (e as StepEvent).Method.Name);
|
||||
|
||||
@@ -1493,7 +1497,7 @@ public class DebuggerTests
|
||||
|
||||
vm.Exit (5);
|
||||
|
||||
var e = vm.GetNextEvent ();
|
||||
var e = GetNextEvent ();
|
||||
Assert.IsInstanceOfType (typeof (VMDeathEvent), e);
|
||||
|
||||
var p = vm.Process;
|
||||
@@ -1517,7 +1521,7 @@ public class DebuggerTests
|
||||
|
||||
vm.Dispose ();
|
||||
|
||||
var e = vm.GetNextEvent ();
|
||||
var e = GetNextEvent ();
|
||||
Assert.IsInstanceOfType (typeof (VMDisconnectEvent), e);
|
||||
|
||||
var p = vm.Process;
|
||||
@@ -1547,7 +1551,7 @@ public class DebuggerTests
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
|
||||
l = e.Thread.GetFrames ()[0].Location;
|
||||
@@ -1558,28 +1562,28 @@ public class DebuggerTests
|
||||
int line_base = l.LineNumber;
|
||||
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
l = e.Thread.GetFrames ()[0].Location;
|
||||
Assert.AreEqual ("ln2", l.Method.Name);
|
||||
Assert.AreEqual (line_base + 6, l.LineNumber);
|
||||
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
l = e.Thread.GetFrames ()[0].Location;
|
||||
Assert.AreEqual ("ln1", l.Method.Name);
|
||||
Assert.AreEqual (line_base + 1, l.LineNumber);
|
||||
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
l = e.Thread.GetFrames ()[0].Location;
|
||||
Assert.AreEqual ("ln3", l.Method.Name);
|
||||
Assert.AreEqual (line_base + 10, l.LineNumber);
|
||||
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
l = e.Thread.GetFrames ()[0].Location;
|
||||
Assert.AreEqual ("ln1", l.Method.Name);
|
||||
@@ -1637,7 +1641,7 @@ public class DebuggerTests
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsInstanceOfType (typeof (AssemblyLoadEvent), e);
|
||||
Assert.IsTrue ((e as AssemblyLoadEvent).Assembly.Location.EndsWith ("System.dll"));
|
||||
|
||||
@@ -1904,7 +1908,7 @@ public class DebuggerTests
|
||||
StackFrame invoke_frame = null;
|
||||
|
||||
try {
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsInstanceOfType (typeof (BreakpointEvent), e);
|
||||
// Check stack trace support and invokes
|
||||
var frames = e.Thread.GetFrames ();
|
||||
@@ -1982,7 +1986,7 @@ public class DebuggerTests
|
||||
vm.Resume ();
|
||||
}, null);
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.AreEqual (EventType.TypeLoad, e.EventType);
|
||||
}
|
||||
|
||||
@@ -1999,18 +2003,20 @@ public class DebuggerTests
|
||||
|
||||
Assert.IsTrue (e.Thread.ThreadId > 0);
|
||||
|
||||
Assert.AreEqual (e.Thread.TID, e.Thread.TID);
|
||||
|
||||
vm.EnableEvents (EventType.ThreadStart, EventType.ThreadDeath);
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsInstanceOfType (typeof (ThreadStartEvent), e);
|
||||
var state = e.Thread.ThreadState;
|
||||
Assert.IsTrue (state == ThreadState.Running || state == ThreadState.Unstarted);
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsInstanceOfType (typeof (ThreadDeathEvent), e);
|
||||
Assert.AreEqual (ThreadState.Stopped, e.Thread.ThreadState);
|
||||
}
|
||||
@@ -2104,7 +2110,7 @@ public class DebuggerTests
|
||||
|
||||
// Step into invoke2
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
Assert.AreEqual ("invoke2", (e as StepEvent).Method.Name);
|
||||
|
||||
@@ -2121,7 +2127,7 @@ public class DebuggerTests
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsInstanceOfType (typeof (ExceptionEvent), e);
|
||||
Assert.AreEqual ("OverflowException", (e as ExceptionEvent).Exception.Type.Name);
|
||||
|
||||
@@ -2137,7 +2143,7 @@ public class DebuggerTests
|
||||
// Skip the throwing of the second OverflowException
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsInstanceOfType (typeof (ExceptionEvent), e);
|
||||
Assert.AreEqual ("ArgumentException", (e as ExceptionEvent).Exception.Type.Name);
|
||||
req.Disable ();
|
||||
@@ -2148,7 +2154,7 @@ public class DebuggerTests
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsInstanceOfType (typeof (ExceptionEvent), e);
|
||||
Assert.AreEqual ("OverflowException", (e as ExceptionEvent).Exception.Type.Name);
|
||||
req.Disable ();
|
||||
@@ -2159,7 +2165,7 @@ public class DebuggerTests
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsInstanceOfType (typeof (ExceptionEvent), e);
|
||||
Assert.AreEqual ("NullReferenceException", (e as ExceptionEvent).Exception.Type.Name);
|
||||
req.Disable ();
|
||||
@@ -2170,7 +2176,7 @@ public class DebuggerTests
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsInstanceOfType (typeof (ExceptionEvent), e);
|
||||
Assert.AreEqual ("Exception", (e as ExceptionEvent).Exception.Type.Name);
|
||||
frames = e.Thread.GetFrames ();
|
||||
@@ -2183,7 +2189,7 @@ public class DebuggerTests
|
||||
sreq.Enable ();
|
||||
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsInstanceOfType (typeof (StepEvent), e);
|
||||
frames = e.Thread.GetFrames ();
|
||||
Assert.AreEqual ("exceptions", frames [0].Method.Name);
|
||||
@@ -2206,7 +2212,7 @@ public class DebuggerTests
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.AreEqual (EventType.Breakpoint, e.EventType);
|
||||
Assert.IsTrue (e is BreakpointEvent);
|
||||
Assert.AreEqual (m.Name, (e as BreakpointEvent).Method.Name);
|
||||
@@ -2244,7 +2250,7 @@ public class DebuggerTests
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
var e = vm.GetNextEvent ();
|
||||
var e = GetNextEvent ();
|
||||
Assert.AreEqual (EventType.Breakpoint, e.EventType);
|
||||
Assert.IsTrue (e is BreakpointEvent);
|
||||
Assert.AreEqual (filter_method.Name, (e as BreakpointEvent).Method.Name);
|
||||
@@ -2319,7 +2325,7 @@ public class DebuggerTests
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsInstanceOfType (typeof (ExceptionEvent), e);
|
||||
Assert.AreEqual ("NullReferenceException", (e as ExceptionEvent).Exception.Type.Name);
|
||||
|
||||
@@ -2340,7 +2346,7 @@ public class DebuggerTests
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsInstanceOfType (typeof (AppDomainCreateEvent), e);
|
||||
|
||||
var domain = (e as AppDomainCreateEvent).Domain;
|
||||
@@ -2352,7 +2358,7 @@ public class DebuggerTests
|
||||
|
||||
while (true) {
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
if (e is BreakpointEvent)
|
||||
break;
|
||||
}
|
||||
@@ -2375,7 +2381,7 @@ public class DebuggerTests
|
||||
|
||||
while (true) {
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
if (e is BreakpointEvent)
|
||||
break;
|
||||
}
|
||||
@@ -2388,7 +2394,7 @@ public class DebuggerTests
|
||||
// Run until the unload
|
||||
while (true) {
|
||||
vm.Resume ();
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
if (e is AssemblyUnloadEvent) {
|
||||
continue;
|
||||
} else {
|
||||
@@ -2561,7 +2567,7 @@ public class DebuggerTests
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is BreakpointEvent);
|
||||
|
||||
var req = vm.CreateStepRequest (e.Thread);
|
||||
@@ -2571,7 +2577,7 @@ public class DebuggerTests
|
||||
|
||||
vm.Resume ();
|
||||
|
||||
e = vm.GetNextEvent ();
|
||||
e = GetNextEvent ();
|
||||
Assert.IsTrue (e is StepEvent);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// MonoTaskScheduler.cs
|
||||
//
|
||||
// Author:
|
||||
// Jérémie "Garuma" Laval <[email protected]>
|
||||
//
|
||||
// Copyright (c) 2011 Jérémie "Garuma" Laval
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#if NET_4_0
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Mono.Threading.Tasks
|
||||
{
|
||||
public interface IMonoTaskScheduler
|
||||
{
|
||||
void MonoParticipateUntil (Task task);
|
||||
bool MonoParticipateUntil (Task task, ManualResetEventSlim predicateEvt, int millisecondsTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -310,9 +310,12 @@ namespace Mono.Remoting.Channels.Unix
|
||||
}
|
||||
finally
|
||||
{
|
||||
_stream.Close();
|
||||
_client.Close ();
|
||||
_serverChannel.ReleaseConnection (Thread.CurrentThread);
|
||||
try {
|
||||
_serverChannel.ReleaseConnection (Thread.CurrentThread);
|
||||
_stream.Close();
|
||||
_client.Close ();
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -232,7 +232,8 @@ namespace Mono.Security.X509 {
|
||||
// If privateKey it's available, load it too..
|
||||
CspParameters cspParams = new CspParameters ();
|
||||
cspParams.KeyContainerName = CryptoConvert.ToHex (cert.Hash);
|
||||
cspParams.Flags = CspProviderFlags.UseMachineKeyStore;
|
||||
if (_storePath.StartsWith (X509StoreManager.LocalMachinePath))
|
||||
cspParams.Flags = CspProviderFlags.UseMachineKeyStore;
|
||||
KeyPairPersistence kpp = new KeyPairPersistence (cspParams);
|
||||
|
||||
if (!kpp.Load ())
|
||||
@@ -314,7 +315,7 @@ namespace Mono.Security.X509 {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
#if !INSIDE_CORLIB
|
||||
#if !NET_2_1
|
||||
private void ImportPrivateKey (X509Certificate certificate, CspParameters cspParams)
|
||||
{
|
||||
RSACryptoServiceProvider rsaCsp = certificate.RSA as RSACryptoServiceProvider;
|
||||
|
||||
+5
-2
@@ -4,7 +4,7 @@
|
||||
// Author:
|
||||
// Atsushi Enomoto <[email protected]>
|
||||
//
|
||||
// Copyright (C) 2008 Novell Inc. http://novell.com
|
||||
// Copyright (C) 2008-2011 Novell Inc. http://novell.com
|
||||
//
|
||||
|
||||
//
|
||||
@@ -44,6 +44,9 @@ namespace System.ComponentModel.DataAnnotations
|
||||
MultilineText,
|
||||
EmailAddress,
|
||||
Password,
|
||||
Url
|
||||
Url,
|
||||
#if NET_4_0
|
||||
ImageUrl
|
||||
#endif
|
||||
}
|
||||
}
|
||||
+3
@@ -39,5 +39,8 @@ namespace System.ComponentModel.DataAnnotations
|
||||
public bool ConvertEmptyStringToNull { get; set; }
|
||||
public string DataFormatString { get; set; }
|
||||
public string NullDisplayText { get; set; }
|
||||
#if NET_4_0
|
||||
public bool HtmlEncode { get; set; }
|
||||
#endif
|
||||
}
|
||||
}
|
||||
+25
-5
@@ -3,8 +3,10 @@
|
||||
//
|
||||
// Author:
|
||||
// Atsushi Enomoto <[email protected]>
|
||||
// Antoine Cailliau <[email protected]>
|
||||
//
|
||||
// Copyright (C) 2008 Novell Inc. http://novell.com
|
||||
// Copyright (C) 20011 Maximux Scris. http://maximux.net
|
||||
//
|
||||
|
||||
//
|
||||
@@ -29,29 +31,47 @@
|
||||
//
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace System.ComponentModel.DataAnnotations
|
||||
{
|
||||
[AttributeUsage (AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)]
|
||||
|
||||
#if NET_4_0
|
||||
[AttributeUsage (AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Parameter, AllowMultiple = false)]
|
||||
#else
|
||||
[AttributeUsage (AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)]
|
||||
#endif
|
||||
public class RegularExpressionAttribute : ValidationAttribute
|
||||
{
|
||||
public RegularExpressionAttribute (string pattern)
|
||||
: base(GetDefaultErrorMessage)
|
||||
{
|
||||
if (pattern == null)
|
||||
throw new ArgumentNullException("pattern");
|
||||
Pattern = pattern;
|
||||
}
|
||||
|
||||
public string Pattern { get; private set; }
|
||||
|
||||
[MonoTODO]
|
||||
static string GetDefaultErrorMessage ()
|
||||
{
|
||||
return "The field {0} must match the regular expression {1}.";
|
||||
}
|
||||
|
||||
public override string FormatErrorMessage (string name)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
return string.Format(ErrorMessageString, name, Pattern);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
// LAMESPEC: does not throw ValidationException when value does not match the regular expression
|
||||
public override bool IsValid (object value)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
if (value == null)
|
||||
return true;
|
||||
|
||||
string str = (string) value;
|
||||
Regex regex = new Regex(Pattern);
|
||||
return regex.IsMatch(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
@@ -9,3 +9,4 @@ System.ComponentModel.DataAnnotations/StringLengthAttributeTest.cs
|
||||
System.ComponentModel.DataAnnotations/ValidationAttributeTest.cs
|
||||
System.ComponentModel.DataAnnotations/ValidationContextTest.cs
|
||||
System.ComponentModel.DataAnnotations/ValidationResultTest.cs
|
||||
System.ComponentModel.DataAnnotations/RegularExpressionAttributeTest.cs
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
//
|
||||
// StringLengthAttributeTest.cs
|
||||
//
|
||||
// Authors:
|
||||
// Marek Habersack <[email protected]>
|
||||
//
|
||||
// Copyright (C) 2010 Novell, Inc. (http://novell.com/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text;
|
||||
|
||||
using NUnit.Framework;
|
||||
using MonoTests.Common;
|
||||
|
||||
namespace MonoTests.System.ComponentModel.DataAnnotations
|
||||
{
|
||||
[TestFixture]
|
||||
public class RegularExpressionAttributeTest
|
||||
{
|
||||
class RegularExpressionAttributePoker : RegularExpressionAttribute
|
||||
{
|
||||
public RegularExpressionAttributePoker (string pattern)
|
||||
: base(pattern)
|
||||
{ }
|
||||
|
||||
public string GetErrorMessageString ()
|
||||
{
|
||||
return ErrorMessageString;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Constructor ()
|
||||
{
|
||||
var rea = new RegularExpressionAttributePoker (@"[A-Za-z]");
|
||||
Assert.AreEqual (@"[A-Za-z]", rea.Pattern, "Patterns not saved correctly.");
|
||||
Assert.AreEqual (null, rea.ErrorMessage, "Error message not null when not yet matched.");
|
||||
Assert.AreEqual ("The field {0} must match the regular expression {1}.", rea.GetErrorMessageString (), "Error message not valid.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void FormatMessageString ()
|
||||
{
|
||||
var rea = new RegularExpressionAttributePoker (@"[A-Za-z]");
|
||||
|
||||
Assert.AreEqual ("The field MyField must match the regular expression [A-Za-z].",
|
||||
rea.FormatErrorMessage ("MyField"),
|
||||
"Error message not correctly formatted.");
|
||||
|
||||
#if !NET_4_0
|
||||
rea = new RegularExpressionAttributePoker (@"[A-Za-z]");
|
||||
#endif
|
||||
rea.ErrorMessage = "Param 0: {0}";
|
||||
Assert.AreEqual ("Param 0: MyField", rea.FormatErrorMessage ("MyField"), "Error message not correctly updated.");
|
||||
|
||||
#if !NET_4_0
|
||||
rea = new RegularExpressionAttributePoker (@"[A-Za-z]");
|
||||
#endif
|
||||
rea.ErrorMessage = "Param 0: {0}; Param 1: {1}";
|
||||
Assert.AreEqual ("Param 0: MyField; Param 1: [A-Za-z]", rea.FormatErrorMessage ("MyField"), "Error message not correctly updated.");
|
||||
Assert.AreEqual ("Param 0: ; Param 1: [A-Za-z]", rea.FormatErrorMessage (null), "Error message fails on null value.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void IsValid ()
|
||||
{
|
||||
var rea = new RegularExpressionAttributePoker (@"[A-Za-z]");
|
||||
|
||||
Assert.IsTrue (rea.IsValid (null), "Null does not match [A-Za-z].");
|
||||
Assert.IsTrue (rea.IsValid ("A"), "'A' does not match [A-Za-z].");
|
||||
Assert.IsTrue (rea.IsValid ("a"), "'a' does not match [A-Za-z].");
|
||||
Assert.IsTrue (rea.IsValid ("Bz"), "'Bz' does not match [A-Za-z].");
|
||||
Assert.IsTrue (rea.IsValid ("string"), "'string' does not match [A-Za-z].");
|
||||
Assert.IsFalse (rea.IsValid (String.Empty), "Empty string matches [A-Za-z].");
|
||||
Assert.IsFalse (rea.IsValid ("0123456789"), "'0123456789' matches [A-Za-z].");
|
||||
Assert.IsFalse (rea.IsValid ("0123456789"), "'0123456789A' matches [A-Za-z].");
|
||||
AssertExtensions.Throws<InvalidCastException> (() => {
|
||||
rea.IsValid (123);
|
||||
}, "Casting does not fails");
|
||||
AssertExtensions.Throws<InvalidCastException> (() => {
|
||||
rea.IsValid (DateTime.Now);
|
||||
}, "Casting does not fails");
|
||||
|
||||
rea = new RegularExpressionAttributePoker ("");
|
||||
Assert.IsTrue (rea.IsValid (null), "null does not match empty pattern");
|
||||
Assert.IsTrue (rea.IsValid (String.Empty), "empty string does not match empty pattern");
|
||||
Assert.IsTrue (rea.IsValid ("string"), "'string' does not match empty pattern");
|
||||
|
||||
AssertExtensions.Throws<ArgumentNullException> (() => {
|
||||
rea = new RegularExpressionAttributePoker (null);
|
||||
}, "Null pattern allowed");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: SecurityPermission (SecurityAction.RequestMinimum, SkipVerification = true)]
|
||||
|
||||
#if NET_4_0 || MOONLIGHT
|
||||
#if NET_4_0 || MOONLIGHT || MOBILE
|
||||
[assembly: TypeForwardedTo (typeof (System.Security.Cryptography.Aes))]
|
||||
#endif
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace System.Collections.Generic {
|
||||
[DebuggerDisplay ("Count={Count}")]
|
||||
[DebuggerTypeProxy (typeof (CollectionDebuggerView<,>))]
|
||||
public class HashSet<T> : ICollection<T>, ISerializable, IDeserializationCallback
|
||||
#if NET_4_0 || MOONLIGHT
|
||||
#if NET_4_0 || MOONLIGHT || MOBILE
|
||||
, ISet<T>
|
||||
#endif
|
||||
{
|
||||
|
||||
Loaded 100 of 628 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user