mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 11:21:08 -10:00
Compare commits
748
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce3b0b7564 | ||
|
|
a9777b31fc | ||
|
|
7dcacbb5bf | ||
|
|
5f8f48145d | ||
|
|
b8052728ea | ||
|
|
3f823404fc | ||
|
|
e3658fe73e | ||
|
|
3f43883b30 | ||
|
|
c9f2555f4a | ||
|
|
8fa55bb406 | ||
|
|
ea78b00406 | ||
|
|
fb2c69e852 | ||
|
|
26536ad29f | ||
|
|
24702d5e64 | ||
|
|
79bf69008d | ||
|
|
0d20226656 | ||
|
|
e4f59e1fa0 | ||
|
|
bf77046abc | ||
|
|
985f57d2b4 | ||
|
|
aca8c70648 | ||
|
|
be8a6afd4a | ||
|
|
b313b63718 | ||
|
|
80238cef2f | ||
|
|
776a4cb2b5 | ||
|
|
a96c5dd131 | ||
|
|
c79e051d35 | ||
|
|
0adb5a6dbf | ||
|
|
64ba822460 | ||
|
|
db59c744af | ||
|
|
d0ecf17cec | ||
|
|
86b0b2afed | ||
|
|
db9d1fffba | ||
|
|
c5c488ec9d | ||
|
|
11cee69b5f | ||
|
|
0dd62ba176 | ||
|
|
40f9aba00f | ||
|
|
643148f131 | ||
|
|
099d0f0e34 | ||
|
|
9187dbc0d9 | ||
|
|
a9c68584df | ||
|
|
50dadb263b | ||
|
|
1106b9be5f | ||
|
|
ec6e3150f8 | ||
|
|
824336a958 | ||
|
|
5a414980ea | ||
|
|
7215e2b879 | ||
|
|
12d359a6c4 | ||
|
|
182883c4ba | ||
|
|
1ed5a802a9 | ||
|
|
b0a314db2c | ||
|
|
4234f30930 | ||
|
|
12de169c29 | ||
|
|
cafcafe8d7 | ||
|
|
9dd0c9aaa0 | ||
|
|
8e5e7a293e | ||
|
|
e430abe428 | ||
|
|
8ed33a951d | ||
|
|
ef74fcb6bb | ||
|
|
98cf1c90d4 | ||
|
|
aacbe2f237 | ||
|
|
7ac57f726f | ||
|
|
89fee7d373 | ||
|
|
3d56703e92 | ||
|
|
53523879e8 | ||
|
|
7290370f37 | ||
|
|
5923bba0bf | ||
|
|
c8a824af78 | ||
|
|
bb3e8d2323 | ||
|
|
2c74b21642 | ||
|
|
3e7bd993d8 | ||
|
|
ffbdeac062 | ||
|
|
e72666919a | ||
|
|
e57e16fee4 | ||
|
|
af23f3ee26 | ||
|
|
1e137b7fcb | ||
|
|
5340b41cd1 | ||
|
|
11c5664fb4 | ||
|
|
59d034e8a7 | ||
|
|
b178109c1e | ||
|
|
a2a78ecc5d | ||
|
|
c540e335c3 | ||
|
|
b7aaf47762 | ||
|
|
b80dca6c9b | ||
|
|
3dd79d0752 | ||
|
|
a8cb34edbf | ||
|
|
812ee3308e | ||
|
|
53c2bea069 | ||
|
|
e56d2c760b | ||
|
|
3e9df709c8 | ||
|
|
1bd073b713 | ||
|
|
e60acb3ab0 | ||
|
|
6c94fea797 | ||
|
|
a4ae5ad77a | ||
|
|
a8ef691b71 | ||
|
|
047b8446d4 | ||
|
|
66b152ffe0 | ||
|
|
7f3f7f3d28 | ||
|
|
fcd76072e0 | ||
|
|
b4e8b39a6e | ||
|
|
e22f04bbdc | ||
|
|
ebab6e9fad | ||
|
|
fe220bb14f | ||
|
|
2af17e6d19 | ||
|
|
5bbd6c23f8 | ||
|
|
320abe5356 | ||
|
|
cee9574eec | ||
|
|
6cc6d1f172 | ||
|
|
fd0bfb7e2e | ||
|
|
8f8e0a9b6e | ||
|
|
71f131be40 | ||
|
|
c96c5db231 | ||
|
|
4e0819daab | ||
|
|
07ddd5f698 | ||
|
|
9ec474d427 | ||
|
|
0810ccda41 | ||
|
|
f7a4dbc112 | ||
|
|
a247e53faa | ||
|
|
c86ebb4da5 | ||
|
|
b225c4736c | ||
|
|
992872bb5d | ||
|
|
a4d5c71207 | ||
|
|
958ce2ba14 | ||
|
|
82e0de5779 | ||
|
|
6e20527322 | ||
|
|
9c4c7d85e0 | ||
|
|
c52ce4b572 | ||
|
|
5b9892f071 | ||
|
|
60f34bbaed | ||
|
|
ff39c58bac | ||
|
|
249e6665eb | ||
|
|
3cd7aaf9c8 | ||
|
|
40d02e9a1d | ||
|
|
725ac8d811 | ||
|
|
b34102015d | ||
|
|
b311360048 | ||
|
|
20808baa2c | ||
|
|
b78ad6ad48 | ||
|
|
b93091c617 | ||
|
|
d6b8fed5be | ||
|
|
f12d23c5cc | ||
|
|
f7bbde7bb5 | ||
|
|
0e15d77a17 | ||
|
|
4e01dad1f8 | ||
|
|
406d680f31 | ||
|
|
7bde20118b | ||
|
|
3a7370aefc | ||
|
|
2087d7c1a1 | ||
|
|
ed57d90570 | ||
|
|
fc3f496d1b | ||
|
|
39ece5f8c7 | ||
|
|
b5b8d4a42e | ||
|
|
792bd0b4e3 | ||
|
|
e8e244f839 | ||
|
|
bb58f668b3 | ||
|
|
ecdf344983 | ||
|
|
6623fc543d | ||
|
|
1e38c9d065 | ||
|
|
30719eac23 | ||
|
|
be791133e9 | ||
|
|
ba41a4afc3 | ||
|
|
7001015c8a | ||
|
|
cb86a2cae2 | ||
|
|
2023fd51cf | ||
|
|
ee0c82f938 | ||
|
|
f66c15fa4c | ||
|
|
870a168078 | ||
|
|
f1e5ff5830 | ||
|
|
ec56b2399e | ||
|
|
98567347b0 | ||
|
|
d1ef9e9bc0 | ||
|
|
1d15cb6eab | ||
|
|
2f6c884c39 | ||
|
|
3007742461 | ||
|
|
dd02160e29 | ||
|
|
04ceb5cec2 | ||
|
|
4c251cb528 | ||
|
|
f29c6b4014 | ||
|
|
5d3bd4296d | ||
|
|
7b4e9fe3b3 | ||
|
|
e127fbdbc8 | ||
|
|
da38ea1a3c | ||
|
|
80b18e5e78 | ||
|
|
b08fcbf349 | ||
|
|
4448207b46 | ||
|
|
c183437b77 | ||
|
|
0bc62c64f2 | ||
|
|
f9f20656d9 | ||
|
|
1cf96c874c | ||
|
|
2e938cedc3 | ||
|
|
8aae8a860c | ||
|
|
72c9964603 | ||
|
|
045c255762 | ||
|
|
441e34087e | ||
|
|
b754115f2b | ||
|
|
94398a1154 | ||
|
|
cf3968f176 | ||
|
|
6101dfa1e7 | ||
|
|
2bb69090d7 | ||
|
|
32c89f8e51 | ||
|
|
733baa249e | ||
|
|
1fc9d8bd0b | ||
|
|
c596b87264 | ||
|
|
51ede8ef25 | ||
|
|
92d8d69c21 | ||
|
|
7ccc860767 | ||
|
|
a19eee8543 | ||
|
|
f00f059724 | ||
|
|
db74186f65 | ||
|
|
d6b8f09a9b | ||
|
|
be077e583a | ||
|
|
0a8951258f | ||
|
|
adaeb6075b | ||
|
|
6c25b86257 | ||
|
|
1d602e9364 | ||
|
|
a8985dc3ec | ||
|
|
1756d9ea31 | ||
|
|
63e2c4a403 | ||
|
|
35c7e0b062 | ||
|
|
e49c454e06 | ||
|
|
1b676d2766 | ||
|
|
a0e8d07f2b | ||
|
|
9aee6ad25d | ||
|
|
f00c5a545b | ||
|
|
7d67acee8b | ||
|
|
30cf8768c4 | ||
|
|
64c827f318 | ||
|
|
f13dcb35bf | ||
|
|
85f294ee2f | ||
|
|
0e091a62fa | ||
|
|
42e4086945 | ||
|
|
7590b8bb30 | ||
|
|
455746a0ce | ||
|
|
371bc51b1c | ||
|
|
badc22bbae | ||
|
|
2d7a5669d2 | ||
|
|
89209acd58 | ||
|
|
9a4bd9308e | ||
|
|
3527ec8621 | ||
|
|
e812234121 | ||
|
|
b8397a6eeb | ||
|
|
be0b6c8933 | ||
|
|
cbd4fef05a | ||
|
|
4f2774fa80 | ||
|
|
cf967de406 | ||
|
|
5167cc3dae | ||
|
|
12ce3d1370 | ||
|
|
fa5e96cdf7 | ||
|
|
18eb35983b | ||
|
|
b80343fd5b | ||
|
|
34f18b6876 | ||
|
|
c690aa95bc | ||
|
|
9f33f58799 | ||
|
|
e30eeacd70 | ||
|
|
3e9fccb813 | ||
|
|
e25503422b | ||
|
|
69e64f8d72 | ||
|
|
1585b98d92 | ||
|
|
c60c84c55d | ||
|
|
1eae886946 | ||
|
|
4b7ca990ad | ||
|
|
aabd50d5ad | ||
|
|
f56f2a679c | ||
|
|
e3ec5dcffb | ||
|
|
b428261ea6 | ||
|
|
7711cbf01a | ||
|
|
ce550ab14b | ||
|
|
6d67acf0d0 | ||
|
|
82f415e01a | ||
|
|
4b9f33b4d5 | ||
|
|
bf997c57b6 | ||
|
|
4395aab675 | ||
|
|
aad5ac41fa | ||
|
|
9a743feb99 | ||
|
|
353b636e4a | ||
|
|
50f46f1fac | ||
|
|
6e597dfd63 | ||
|
|
1a357d9f4e | ||
|
|
12692327a1 | ||
|
|
e166179eb8 | ||
|
|
294900133a | ||
|
|
df939989d8 | ||
|
|
a1c49cd4e9 | ||
|
|
b374152512 | ||
|
|
bbc79f7b41 | ||
|
|
841b593bd9 | ||
|
|
49805cb00d | ||
|
|
0256398770 | ||
|
|
38855bc712 | ||
|
|
017b4ed819 | ||
|
|
d47c02350c | ||
|
|
4b4f74955d | ||
|
|
211be59492 | ||
|
|
55a91737da | ||
|
|
568b8cf74d | ||
|
|
bee257b69b | ||
|
|
36353034c9 | ||
|
|
b4b3b7b978 | ||
|
|
550ca25837 | ||
|
|
5cb757c95b | ||
|
|
c6fb9f9494 | ||
|
|
1c664cbb1e | ||
|
|
dcc8112e68 | ||
|
|
7f8aafbe7d | ||
|
|
837bf42ce7 | ||
|
|
084a76ecea | ||
|
|
3da978e41b | ||
|
|
e8c3443bd3 | ||
|
|
14b494ed61 | ||
|
|
ef214d3a25 | ||
|
|
5038f10bb6 | ||
|
|
fd2b90b73b | ||
|
|
7225ae8eed | ||
|
|
4f8349919a | ||
|
|
0214f7431a | ||
|
|
dbdcec54b4 | ||
|
|
87cc02a04a | ||
|
|
f5bba434cd | ||
|
|
7048e3f49e | ||
|
|
ac1ad54ded | ||
|
|
a1953b3f77 | ||
|
|
b100e0eed6 | ||
|
|
24e787e9ff | ||
|
|
916943ce1a | ||
|
|
93a4e248be | ||
|
|
8494641805 | ||
|
|
82b37d914c | ||
|
|
8c579dfce2 | ||
|
|
95af93f266 | ||
|
|
41b1fe814e | ||
|
|
ac1e8e16a2 | ||
|
|
e8a578407b | ||
|
|
450b0f1c4a | ||
|
|
d2b840c9fc | ||
|
|
ad9ddef21a | ||
|
|
5c1fe2fedb | ||
|
|
268adea870 | ||
|
|
70910f3f04 | ||
|
|
02f2d4dbf7 | ||
|
|
dcec5908af | ||
|
|
85e594b968 | ||
|
|
c08e02bc59 | ||
|
|
a92669fc05 | ||
|
|
0cce6b2bf5 | ||
|
|
9f29e21ade | ||
|
|
93dd831a8b | ||
|
|
b860a9145c | ||
|
|
c69896b97b | ||
|
|
094614ba92 | ||
|
|
2bbbccf106 | ||
|
|
37589e862a | ||
|
|
80890aa751 | ||
|
|
05745bacdf | ||
|
|
26bbac8c8a | ||
|
|
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 | ||
|
|
586f777ec2 | ||
|
|
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
|
||||
+40
-2
@@ -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.2)
|
||||
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)
|
||||
@@ -1552,6 +1560,12 @@ if test x$target_win32 = xno; then
|
||||
AC_DEFINE(HAVE_EPOLL, 1, [epoll supported])
|
||||
fi
|
||||
|
||||
havekqueue=no
|
||||
AC_CHECK_FUNCS(kqueue, , AC_MSG_CHECKING(for kqueue in sys/event.h)
|
||||
AC_TRY_LINK([#include <sys/event.h>],
|
||||
[ kqueue(); ],
|
||||
AC_DEFINE(HAVE_KQUEUE, 1, [Have kqueue]) AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no)))
|
||||
dnl ******************************
|
||||
dnl *** Checks for SIOCGIFCONF ***
|
||||
dnl ******************************
|
||||
@@ -1746,6 +1760,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?))
|
||||
@@ -2249,8 +2268,10 @@ case "$host" in
|
||||
arch_target=arm;
|
||||
ACCESS_UNALIGNED="no"
|
||||
JIT_SUPPORTED=yes
|
||||
CPPFLAGS="$CPPFLAGS -DARM_FPU_NONE=1"
|
||||
CPPFLAGS="$CPPFLAGS -DARM_FPU_VFP=1 -D__ARM_EABI__ -DHAVE_ARMV6=1"
|
||||
jit_wanted=true
|
||||
# libgc's gc_locks.h depends on this
|
||||
NESTED_LIBGC_FLAGS="$NESTED_LIBGC_FLAGS -DHAVE_ARMV6"
|
||||
sgen_supported=true
|
||||
;;
|
||||
arm*-linux*)
|
||||
@@ -2548,6 +2569,18 @@ if test ${TARGET} = ARM && test x$cross_compiling = xno && test x$enable_mcs_bui
|
||||
AC_MSG_RESULT($fpu)
|
||||
CPPFLAGS="$CPPFLAGS -DARM_FPU_$fpu=1"
|
||||
unset fpu
|
||||
|
||||
AC_MSG_CHECKING(for ARMV6)
|
||||
AC_TRY_RUN([
|
||||
int main () { __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory"); return 0; }
|
||||
], armv6=yes, armv6=no)
|
||||
|
||||
AC_MSG_RESULT($armv6)
|
||||
if test ${armv6} = yes; then
|
||||
AC_DEFINE(HAVE_ARMV6, 1, "Host supports ARMV6 instructions")
|
||||
# libgc's gc_locks.h depends on this
|
||||
NESTED_LIBGC_FLAGS="$NESTED_LIBGC_FLAGS -DHAVE_ARMV6"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test ${TARGET} = unknown; then
|
||||
@@ -2964,6 +2997,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
|
||||
|
||||
@@ -3,3 +3,5 @@
|
||||
/config
|
||||
/.cvsignore
|
||||
/*.pc
|
||||
/gdb/mono-sgen-gdb.py
|
||||
/mono-sgen-gdb.py
|
||||
+8
-2
@@ -21,8 +21,10 @@ pkgconfigdir = $(libdir)/pkgconfig
|
||||
|
||||
if SUPPORT_SGEN
|
||||
SGENPCFILE=monosgen-2.pc
|
||||
SGENGDBFILE=mono-sgen-gdb.py
|
||||
else
|
||||
SGENPCFILE=
|
||||
SGENGDBFILE=
|
||||
endif
|
||||
|
||||
if JIT_SUPPORTED
|
||||
@@ -38,11 +40,15 @@ pkgconfig_DATA= mint.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc mon
|
||||
endif
|
||||
|
||||
DISTCLEANFILES= mono-2.pc mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
|
||||
system.web.extensions.design_1.0.pc mono.web.pc system.web.mvc.pc system.web.mvc2.pc $(SGENPCFILE)
|
||||
system.web.extensions.design_1.0.pc mono.web.pc system.web.mvc.pc system.web.mvc2.pc monosgen-2.pc mono-sgen-gdb.py
|
||||
|
||||
mono_DATA = config \
|
||||
browscap.ini
|
||||
|
||||
gdbdir = $(bindir)
|
||||
|
||||
gdb_DATA = gdb/mono-gdb.py
|
||||
mono-sgen-gdb.py: gdb/mono-gdb.py
|
||||
cp $< $@
|
||||
|
||||
gdb_DATA = gdb/mono-gdb.py $(SGENGDBFILE)
|
||||
|
||||
@@ -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
|
||||
@@ -62,8 +62,6 @@ typedef int pid_t;
|
||||
#undef G_HAVE_STRNDUP
|
||||
#define G_HAVE_GETOPT_H 1
|
||||
|
||||
int vasprintf(char **ret, const char *fmt, va_list ap);
|
||||
|
||||
/* disable the following warnings
|
||||
* C4100: The formal parameter is not referenced in the body of the function. The unreferenced parameter is ignored.
|
||||
* C4127: conditional expression is constant
|
||||
@@ -71,4 +69,5 @@ int vasprintf(char **ret, const char *fmt, va_list ap);
|
||||
#pragma warning(disable:4100 4127)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
typedef void * GPid;
|
||||
#endif
|
||||
@@ -47,14 +47,14 @@ g_dir_open (const gchar *path, guint flags, GError **error)
|
||||
GDir *dir;
|
||||
gunichar2* path_utf16;
|
||||
gunichar2* path_utf16_search;
|
||||
WIN32_FIND_DATA find_data;
|
||||
WIN32_FIND_DATAW find_data;
|
||||
|
||||
g_return_val_if_fail (path != NULL, NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
dir = g_new0 (GDir, 1);
|
||||
path_utf16 = u8to16 (path);
|
||||
path_utf16_search = g_malloc ((wcslen(path_utf16) + 3)*sizeof(gunichar2));
|
||||
path_utf16_search = g_malloc ((wcslen((wchar_t *) path_utf16) + 3)*sizeof(gunichar2));
|
||||
wcscpy (path_utf16_search, path_utf16);
|
||||
wcscat (path_utf16_search, L"\\*");
|
||||
|
||||
@@ -72,7 +72,7 @@ g_dir_open (const gchar *path, guint flags, GError **error)
|
||||
g_free (path_utf16_search);
|
||||
g_free (path_utf16);
|
||||
|
||||
while ((wcscmp (find_data.cFileName, L".") == 0) || (wcscmp (find_data.cFileName, L"..") == 0)) {
|
||||
while ((wcscmp ((wchar_t *) find_data.cFileName, L".") == 0) || (wcscmp ((wchar_t *) find_data.cFileName, L"..") == 0)) {
|
||||
if (!FindNextFileW (dir->handle, &find_data)) {
|
||||
if (error) {
|
||||
gint err = errno;
|
||||
@@ -91,7 +91,7 @@ g_dir_open (const gchar *path, guint flags, GError **error)
|
||||
const gchar *
|
||||
g_dir_read_name (GDir *dir)
|
||||
{
|
||||
WIN32_FIND_DATA find_data;
|
||||
WIN32_FIND_DATAW find_data;
|
||||
|
||||
g_return_val_if_fail (dir != NULL && dir->handle != 0, NULL);
|
||||
|
||||
@@ -111,7 +111,7 @@ g_dir_read_name (GDir *dir)
|
||||
dir->next = NULL;
|
||||
return dir->current;
|
||||
}
|
||||
} while ((wcscmp (find_data.cFileName, L".") == 0) || (wcscmp (find_data.cFileName, L"..") == 0));
|
||||
} while ((wcscmp ((wchar_t *) find_data.cFileName, L".") == 0) || (wcscmp ((wchar_t *) find_data.cFileName, L"..") == 0));
|
||||
|
||||
dir->next = u16to8 (find_data.cFileName);
|
||||
return dir->current;
|
||||
|
||||
@@ -33,9 +33,14 @@
|
||||
#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>
|
||||
#endif
|
||||
#ifdef G_OS_WIN32
|
||||
int mkstemp (char *tmp_template);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -39,9 +39,13 @@
|
||||
#ifdef G_OS_WIN32
|
||||
#include <io.h>
|
||||
#define open _open
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(x) ((x & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#ifndef S_ISDIR
|
||||
#define S_ISDIR(x) ((x & _S_IFMT) == _S_IFDIR)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int mkstemp (char *tmp_template)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
+7
-7
@@ -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>
|
||||
@@ -44,6 +40,12 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
/* MSC and Cross-compilatin will use this */
|
||||
int vasprintf (char **strp, const char *fmt, va_list ap);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Basic data types
|
||||
*/
|
||||
@@ -673,7 +675,7 @@ gunichar *g_utf16_to_ucs4 (const gunichar2 *str, glong len, glong *items_read,
|
||||
#define u8to16(str) g_utf8_to_utf16(str, (glong)strlen(str), NULL, NULL, NULL)
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#define u16to8(str) g_utf16_to_utf8(str, (glong)wcslen(str), NULL, NULL, NULL)
|
||||
#define u16to8(str) g_utf16_to_utf8((gunichar2 *) (str), (glong)wcslen((wchar_t *) (str)), NULL, NULL, NULL)
|
||||
#else
|
||||
#define u16to8(str) g_utf16_to_utf8(str, (glong)strlen(str), NULL, NULL, NULL)
|
||||
#endif
|
||||
@@ -716,8 +718,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);
|
||||
|
||||
@@ -80,7 +80,7 @@ g_unsetenv(const gchar *variable)
|
||||
{
|
||||
gunichar2 *var;
|
||||
var = u8to16(variable);
|
||||
SetEnvironmentVariableW(var, TEXT(""));
|
||||
SetEnvironmentVariableW(var, L"");
|
||||
g_free(var);
|
||||
}
|
||||
|
||||
@@ -98,14 +98,15 @@ g_path_is_absolute (const char *filename)
|
||||
{
|
||||
g_return_val_if_fail (filename != NULL, FALSE);
|
||||
|
||||
if (filename[0] != '\0' && filename[1] != '\0')
|
||||
if (filename[1] == ':' && filename[2] != '\0' &&
|
||||
if (filename[0] != '\0' && filename[1] != '\0') {
|
||||
if (filename[1] == ':' && filename[2] != '\0' &&
|
||||
(filename[2] == '\\' || filename[2] == '/'))
|
||||
return TRUE;
|
||||
/* UNC paths */
|
||||
else if (filename[0] == '\\' && filename[1] == '\\' &&
|
||||
filename[2] != '\0')
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ g_module_open (const gchar *file, GModuleFlags flags)
|
||||
gunichar2 *file16;
|
||||
file16 = u8to16(file);
|
||||
module->main_module = FALSE;
|
||||
module->handle = LoadLibrary (file16);
|
||||
module->handle = LoadLibraryW (file16);
|
||||
g_free(file16);
|
||||
if (!module->handle) {
|
||||
g_free (module);
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ split_cmdline (const gchar *cmdline, GPtrArray *array, GError **error)
|
||||
} else if (quote_char) {
|
||||
if (c == quote_char) {
|
||||
quote_char = '\0';
|
||||
if (fresh && g_ascii_isspace (*ptr)){
|
||||
if (fresh && (g_ascii_isspace (*ptr) || *ptr == '\0')){
|
||||
g_ptr_array_add (array, g_string_free (str, FALSE));
|
||||
str = g_string_new ("");
|
||||
}
|
||||
|
||||
+2
-1
@@ -79,6 +79,7 @@ gchar ***_NSGetEnviron();
|
||||
extern char **environ;
|
||||
#endif
|
||||
|
||||
#ifndef G_OS_WIN32
|
||||
static int
|
||||
safe_read (int fd, gchar *buffer, gint count, GError **error)
|
||||
{
|
||||
@@ -185,7 +186,7 @@ create_pipe (int *fds, GError **error)
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif /* G_OS_WIN32 */
|
||||
gboolean
|
||||
g_spawn_command_line_sync (const gchar *command_line,
|
||||
gchar **standard_output,
|
||||
|
||||
@@ -300,13 +300,13 @@ g_filename_from_utf8 (const gchar *utf8string, gssize len, gsize *bytes_read, gs
|
||||
gboolean
|
||||
g_get_charset (G_CONST_RETURN char **charset)
|
||||
{
|
||||
if (my_charset == NULL) {
|
||||
#ifdef G_OS_WIN32
|
||||
static char buf[14];
|
||||
sprintf (buf, "CP%u", GetACP ());
|
||||
*charset = buf;
|
||||
is_utf8 = FALSE;
|
||||
static char buf [14];
|
||||
sprintf (buf, "CP%u", GetACP ());
|
||||
my_charset = buf;
|
||||
is_utf8 = FALSE;
|
||||
#else
|
||||
if (my_charset == NULL){
|
||||
/* These shouldn't be heap allocated */
|
||||
#if HAVE_LOCALCHARSET_H
|
||||
my_charset = locale_charset ();
|
||||
@@ -316,12 +316,12 @@ g_get_charset (G_CONST_RETURN char **charset)
|
||||
my_charset = "UTF-8";
|
||||
#endif
|
||||
is_utf8 = strcmp (my_charset, "UTF-8") == 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (charset != NULL)
|
||||
*charset = my_charset;
|
||||
|
||||
#endif
|
||||
return is_utf8;
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -71,7 +71,7 @@ utf8_to_utf16_len (const gchar *str, glong len, glong *items_read, GError **erro
|
||||
ret = 0;
|
||||
|
||||
/* Common case */
|
||||
for (in_pos = 0; in_pos < len && str [in_pos] < 0x80; in_pos++)
|
||||
for (in_pos = 0; in_pos < len && (guchar) str [in_pos] < 0x80; in_pos++)
|
||||
ret ++;
|
||||
|
||||
if (in_pos == len) {
|
||||
@@ -338,6 +338,7 @@ g_utf16_to_utf8 (const gunichar2 *str, glong len, glong *items_read, glong *item
|
||||
} else {
|
||||
surrogate = 0;
|
||||
/* invalid surrogate pair */
|
||||
++in_pos;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
@@ -354,6 +355,7 @@ g_utf16_to_utf8 (const gunichar2 *str, glong len, glong *items_read, glong *item
|
||||
else if (ch >= 0xD800 && ch <= 0xDBFF)
|
||||
surrogate = ch;
|
||||
else if (ch >= 0xDC00 && ch <= 0xDFFF) {
|
||||
++in_pos;
|
||||
/* invalid surrogate pair */
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -17,7 +17,7 @@ int vasprintf(char **ret, const char *fmt, va_list ap)
|
||||
len = vsnprintf(NULL, 0, fmt, ap2);
|
||||
#endif
|
||||
|
||||
if (len > 0 && (buf = malloc((buflen = (size_t) (len + 1)))) != NULL) {
|
||||
if (len >= 0 && (buf = malloc ((buflen = (size_t) (len + 1)))) != NULL) {
|
||||
len = vsnprintf(buf, buflen, fmt, ap);
|
||||
*ret = buf;
|
||||
} else {
|
||||
@@ -28,3 +28,4 @@ int vasprintf(char **ret, const char *fmt, va_list ap)
|
||||
va_end(ap2);
|
||||
return len;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ RESULT
|
||||
test_buildpath ()
|
||||
{
|
||||
char *s;
|
||||
char *buffer = "var/private";
|
||||
char *dir = "/";
|
||||
|
||||
s = g_build_path ("/", "hola///", "//mundo", NULL);
|
||||
if (strcmp (s, "hola/mundo") != 0)
|
||||
@@ -99,6 +101,16 @@ test_buildpath ()
|
||||
return FAILED ("must get a non-NULL return");
|
||||
if (s [0] != 0)
|
||||
return FAILED ("must get an empty string");
|
||||
|
||||
// This is to test the regression introduced by Levi for the Windows support
|
||||
// that code errouneously read below the allowed area (in this case dir [-1]).
|
||||
// and caused all kinds of random errors.
|
||||
dir = "//";
|
||||
dir++;
|
||||
s = g_build_filename (dir, buffer, NULL);
|
||||
if (s [0] != '/')
|
||||
return FAILED ("Must have a '/' at the start");
|
||||
|
||||
g_free (s);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -250,6 +250,14 @@
|
||||
#endif
|
||||
}
|
||||
# define GC_TEST_AND_SET_DEFINED
|
||||
inline static void GC_clear(volatile unsigned int *addr) {
|
||||
#ifdef HAVE_ARMV6
|
||||
/* Memory barrier */
|
||||
__asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory");
|
||||
#endif
|
||||
*(addr) = 0;
|
||||
}
|
||||
# define GC_CLEAR_DEFINED
|
||||
# endif /* ARM32 */
|
||||
# ifdef CRIS
|
||||
inline static int GC_test_and_set(volatile unsigned int *addr) {
|
||||
|
||||
+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
|
||||
|
||||
+77
-5
@@ -41,8 +41,32 @@ Validate the project file against the schema
|
||||
.B \//validate:<schema>
|
||||
Validate the project file against the specified schema
|
||||
.TP
|
||||
.B \//consoleloggerparameters:<params>
|
||||
Parameters for the console logger : PerfomanceSummary, NoSummary, NoItemAndPropertyList
|
||||
.B \//consoleloggerparameters:<params> , /clp:<params>
|
||||
Parameters for the console logger : PerfomanceSummary, Summary, NoSummary, NoItemAndPropertyList, Verbosity
|
||||
.TP
|
||||
.B \//filelogger[n] , /fl[n]
|
||||
Logs the output to a file, named 'msbuild.log' by default. If the optional number 'n' is
|
||||
specified, then it logs to 'msbuild[n].log' . Parameters for this logger, including
|
||||
the log file name can be specified via a corresponding /flp[n] option. Default verbosity
|
||||
for file loggers is 'detailed. 'n' can be between 1-9.
|
||||
.TP
|
||||
.B \//fileloggerparameters[n]:<params> , /flp[n]:<params>
|
||||
Parameters for a file logger. This implies a corresponding /fl[n]. 'n' can be between
|
||||
1-9, and is used to add upto 10 file loggers. Parameters can be, besides the ones available
|
||||
for console logger:
|
||||
.RS
|
||||
.TP
|
||||
.I LogFile=<file>
|
||||
File to which the build log will be written.
|
||||
.TP
|
||||
.I Append
|
||||
If this is used, then the log file is appended to, else a new one will be created.
|
||||
.TP
|
||||
.I Encoding=<encoding>
|
||||
Encoding to use for the log file, eg. UTF-8, ASCII.
|
||||
.TP
|
||||
Eg: xbuild foo.csproj /flp:Verbosity=normal "/flp1:LogFile=build.log;Append;Encoding=ASCII"
|
||||
.RE
|
||||
.TP
|
||||
.B \//nologo
|
||||
Don't show the initial xbuild banner
|
||||
@@ -74,13 +98,57 @@ 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.
|
||||
This is also applicable for the properties $(MSBuildExtensionsPath32) and $(MSBuildExtensionsPath64),
|
||||
and the environment variables have the corresponding names - MSBuildExtensionsPath32/64 .
|
||||
.TP
|
||||
.I "XBUILD_FRAMEWORK_FOLDERS_PATH"
|
||||
With ToolsVersion 4.0, projects can target arbitrary frameworks referenced by TargetFrameworkMoniker,
|
||||
which is of the format:
|
||||
|
||||
Identifier,Version=<version>[,Profile=<profile>]
|
||||
|
||||
Eg. ".NETFramework,Version=v4.0"
|
||||
|
||||
The 3 parts of the moniker are given by the msbuild properties:
|
||||
|
||||
$(TargetFrameworkIdentifier), $(TargetFrameworkVersion) and $(TargetFrameworkProfile)
|
||||
|
||||
This moniker maps to a framework description file on disk:
|
||||
|
||||
<framework_root>/Identifier/Version/[Profile]/RedistList/FrameworkList.xml
|
||||
|
||||
This file is used to determine the path where to find the framework assemblies for this particular framework.
|
||||
|
||||
Framework root here is configurable and is resolved in the following order:
|
||||
|
||||
.nf
|
||||
1. Paths specified in the environment variable $XBUILD_FRAMEWORK_FOLDERS_PATH
|
||||
2. /Library/Frameworks/Mono.framework/External/xbuild-frameworks on Mac OSX.
|
||||
3. MSBuild property $(TargetFrameworkRoot)
|
||||
4. $prefix/lib/mono/xbuild-frameworks (default location)
|
||||
.fi
|
||||
|
||||
XBuild tries the paths given above, in order, till it finds a FrameworkList.xml for the moniker.
|
||||
Running with /v:detailed or higher verbosity will show the various paths that it tries.
|
||||
|
||||
The FrameworkList.xml itself just has a root element like:
|
||||
|
||||
<FileList Name=".NET Framework 3.5" TargetFrameworkDirectory="..\\..\\..\\..\\3.5" IncludeFramework="v3.0">
|
||||
</FileList>
|
||||
|
||||
Here the TargetFrameworkDirectory attribute specifies the directory where the assemblies for
|
||||
this particular framework can be found. If this is not set, then the parent of the folder
|
||||
containing the xml file is taken as the framework directory.
|
||||
|
||||
IncludeFramework attribute specifies the version of a framework (under the *same* $(TargetFrameworkIdentifier))
|
||||
which should be included in the final list of Target framework directories.
|
||||
|
||||
.TP
|
||||
.I "XBUILD_COLORS"
|
||||
If this variable is set, it contains a string of the form
|
||||
@@ -111,10 +179,14 @@ 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
|
||||
Copyright (C) 2009 Novell, Inc (http://www.novell.com)
|
||||
Copyright (C) 2011 Novell, Inc (http://www.novell.com)
|
||||
.SH MAILING LISTS
|
||||
Visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for details.
|
||||
.SH WEB SITE
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -654,6 +654,11 @@ namespace System.Windows.Forms
|
||||
|
||||
public int Init ()
|
||||
{
|
||||
int p = (int) Environment.OSVersion.Platform;
|
||||
if ((p != 4) && (p != 6) && (p != 128))
|
||||
// Not running on Unix.
|
||||
return -1;
|
||||
|
||||
CheckFDOMimePaths ();
|
||||
|
||||
if (!fdo_mime_available)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -35,14 +35,21 @@ namespace Microsoft.Build.BuildEngine {
|
||||
internal class BuildChoose {
|
||||
|
||||
BuildWhen otherwise;
|
||||
Project project;
|
||||
XmlElement xmlElement;
|
||||
//Project project;
|
||||
//ImportedProject importedProject;
|
||||
//XmlElement xmlElement;
|
||||
List <BuildWhen> whens;
|
||||
|
||||
public BuildChoose (XmlElement xmlElement, Project project)
|
||||
: this (xmlElement, project, null)
|
||||
{
|
||||
this.xmlElement = xmlElement;
|
||||
this.project = project;
|
||||
}
|
||||
|
||||
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; }
|
||||
|
||||
@@ -33,13 +33,13 @@ using System.Xml;
|
||||
|
||||
namespace Microsoft.Build.BuildEngine {
|
||||
internal class BuildWhen {
|
||||
Project parentProject;
|
||||
//Project parentProject;
|
||||
GroupingCollection groupingCollection;
|
||||
XmlElement whenElement;
|
||||
|
||||
public BuildWhen (XmlElement whenElement, Project parentProject)
|
||||
{
|
||||
this.parentProject = parentProject;
|
||||
//this.parentProject = parentProject;
|
||||
this.groupingCollection = new GroupingCollection (parentProject);
|
||||
if (whenElement == null)
|
||||
throw new ArgumentNullException ("whenElement");
|
||||
|
||||
+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)
|
||||
|
||||
+3
-3
@@ -46,7 +46,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
Type t = typeof (ConditionFunctionExpression);
|
||||
string [] names = new string [] { "Exists", "HasTrailingSlash" };
|
||||
|
||||
functions = new Dictionary <string, MethodInfo> ();
|
||||
functions = new Dictionary <string, MethodInfo> (StringComparer.InvariantCultureIgnoreCase);
|
||||
foreach (string name in names)
|
||||
functions.Add (name, t.GetMethod (name, BindingFlags.NonPublic | BindingFlags.Static));
|
||||
}
|
||||
@@ -60,10 +60,10 @@ namespace Microsoft.Build.BuildEngine {
|
||||
public override bool BoolEvaluate (Project context)
|
||||
{
|
||||
if (!functions.ContainsKey (name))
|
||||
throw new InvalidOperationException ();
|
||||
throw new InvalidOperationException ("Unknown function named: " + name);
|
||||
|
||||
if (functions [name] == null)
|
||||
throw new InvalidOperationException ();
|
||||
throw new InvalidOperationException ("Unknown function named: " + name);
|
||||
|
||||
MethodInfo mi = functions [name];
|
||||
object [] argsArr = new object [args.Count + 1];
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -197,8 +197,68 @@ namespace Microsoft.Build.BuildEngine {
|
||||
public void ApplyParameter (string parameterName,
|
||||
string parameterValue)
|
||||
{
|
||||
// FIXME: what we should do here? in msbuild it isn't
|
||||
// changing "parameters" property
|
||||
switch (parameterName) {
|
||||
case "PerformanceSummary":
|
||||
this.performanceSummary = true;
|
||||
break;
|
||||
case "Summary":
|
||||
this.showSummary = true;
|
||||
break;
|
||||
case "NoSummary":
|
||||
this.showSummary = false;
|
||||
break;
|
||||
case "NoItemAndPropertyList":
|
||||
this.noItemAndPropertyList = true;
|
||||
break;
|
||||
default:
|
||||
if (parameterName.StartsWith ("Verbosity="))
|
||||
ParseVerbosity (parameterName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ParseVerbosity (string s)
|
||||
{
|
||||
string key, value;
|
||||
if (!TrySplitKeyValuePair (s, out key, out value))
|
||||
throw new LoggerException ("Unknown Verbosity, should be set as 'Verbosity=<verbosity>'");
|
||||
|
||||
switch (value) {
|
||||
case "q":
|
||||
case "quiet":
|
||||
Verbosity = LoggerVerbosity.Quiet;
|
||||
break;
|
||||
case "m":
|
||||
case "minimal":
|
||||
Verbosity = LoggerVerbosity.Minimal;
|
||||
break;
|
||||
case "n":
|
||||
case "normal":
|
||||
Verbosity = LoggerVerbosity.Normal;
|
||||
break;
|
||||
case "d":
|
||||
case "detailed":
|
||||
Verbosity = LoggerVerbosity.Detailed;
|
||||
break;
|
||||
case "diag":
|
||||
case "diagnostic":
|
||||
Verbosity = LoggerVerbosity.Diagnostic;
|
||||
break;
|
||||
default:
|
||||
throw new LoggerException (String.Format ("Unknown verbosity - '{0}'", s));
|
||||
}
|
||||
}
|
||||
|
||||
bool TrySplitKeyValuePair (string pair, out string key, out string value)
|
||||
{
|
||||
key = value = null;
|
||||
string[] parts = pair.Split ('=');
|
||||
if (parts.Length != 2)
|
||||
return false;
|
||||
|
||||
key = parts [0];
|
||||
value = parts [1];
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual void Initialize (IEventSource eventSource)
|
||||
@@ -220,6 +280,9 @@ namespace Microsoft.Build.BuildEngine {
|
||||
eventSource.MessageRaised += MessageHandler;
|
||||
eventSource.WarningRaised += WarningHandler;
|
||||
eventSource.ErrorRaised += ErrorHandler;
|
||||
|
||||
if (!String.IsNullOrEmpty (parameters))
|
||||
ParseParameters ();
|
||||
}
|
||||
|
||||
public void BuildStartedHandler (object sender, BuildStartedEventArgs args)
|
||||
@@ -456,9 +519,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);
|
||||
}
|
||||
@@ -605,21 +670,8 @@ namespace Microsoft.Build.BuildEngine {
|
||||
private void ParseParameters ()
|
||||
{
|
||||
string[] splittedParameters = parameters.Split (';');
|
||||
foreach (string s in splittedParameters ) {
|
||||
switch (s) {
|
||||
case "PerformanceSummary":
|
||||
this.performanceSummary = true;
|
||||
break;
|
||||
case "NoSummary":
|
||||
this.showSummary = false;
|
||||
break;
|
||||
case "NoItemAndPropertyList":
|
||||
this.noItemAndPropertyList = true;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentException ("Invalid parameter : " + s);
|
||||
}
|
||||
}
|
||||
foreach (string s in splittedParameters )
|
||||
ApplyParameter (s, null);
|
||||
}
|
||||
|
||||
public virtual void Shutdown ()
|
||||
@@ -777,8 +829,6 @@ namespace Microsoft.Build.BuildEngine {
|
||||
if (value == null)
|
||||
throw new ArgumentNullException ();
|
||||
parameters = value;
|
||||
if (parameters != String.Empty)
|
||||
ParseParameters ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,6 @@ namespace Microsoft.Build.BuildEngine {
|
||||
{
|
||||
Dictionary <string, bool> excludedItems;
|
||||
List <ITaskItem> includedItems;
|
||||
string[] splitExclude;
|
||||
|
||||
if (includes == null)
|
||||
throw new ArgumentNullException ("Includes");
|
||||
@@ -84,7 +83,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
FileInfo[] fileInfo;
|
||||
|
||||
string name = include_item.ItemSpec;
|
||||
if (name.IndexOf ('?') == -1 && name.IndexOf ('*') == -1) {
|
||||
if (!HasWildcard (name)) {
|
||||
if (!excludedItems.ContainsKey (Path.GetFullPath(name)))
|
||||
includedItems.Add (include_item);
|
||||
} else {
|
||||
@@ -211,6 +210,11 @@ namespace Microsoft.Build.BuildEngine {
|
||||
return fi;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool HasWildcard (string expression)
|
||||
{
|
||||
return expression.IndexOf ('?') >= 0 || expression.IndexOf ('*') >= 0;
|
||||
}
|
||||
|
||||
public DirectoryInfo BaseDirectory {
|
||||
get { return baseDirectory; }
|
||||
|
||||
@@ -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;
|
||||
@@ -44,7 +45,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
const string defaultTasksProjectName = "Microsoft.Common.tasks";
|
||||
EventSource eventSource;
|
||||
bool buildStarted;
|
||||
ToolsetDefinitionLocations toolsetLocations;
|
||||
//ToolsetDefinitionLocations toolsetLocations;
|
||||
BuildPropertyGroup global_properties;
|
||||
//IDictionary importedProjects;
|
||||
List <ILogger> loggers;
|
||||
@@ -72,7 +73,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
public Engine (ToolsetDefinitionLocations locations)
|
||||
: this (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20))
|
||||
{
|
||||
toolsetLocations = locations;
|
||||
//toolsetLocations = locations;
|
||||
}
|
||||
|
||||
public Engine (BuildPropertyGroup globalProperties)
|
||||
@@ -85,7 +86,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
: this (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20))
|
||||
{
|
||||
this.global_properties = globalProperties;
|
||||
toolsetLocations = locations;
|
||||
//toolsetLocations = locations;
|
||||
}
|
||||
|
||||
// engine should be invoked with path where binary files are
|
||||
@@ -228,6 +229,33 @@ namespace Microsoft.Build.BuildEngine {
|
||||
IDictionary targetOutputs,
|
||||
BuildSettings buildFlags, string toolsVersion)
|
||||
{
|
||||
bool result = false;
|
||||
try {
|
||||
StartEngineBuild ();
|
||||
result = BuildProjectFileInternal (projectFile, targetNames, globalProperties, targetOutputs, buildFlags, toolsVersion);
|
||||
return result;
|
||||
} catch (InvalidProjectFileException ie) {
|
||||
this.LogErrorWithFilename (projectFile, ie.Message);
|
||||
this.LogMessage (MessageImportance.Low, String.Format ("{0}: {1}", projectFile, ie.ToString ()));
|
||||
return false;
|
||||
} catch (Exception e) {
|
||||
if (buildStarted) {
|
||||
this.LogErrorWithFilename (projectFile, e.Message);
|
||||
this.LogMessage (MessageImportance.Low, String.Format ("{0}: {1}", projectFile, e.ToString ()));
|
||||
}
|
||||
throw;
|
||||
} finally {
|
||||
EndEngineBuild (result);
|
||||
}
|
||||
}
|
||||
|
||||
bool BuildProjectFileInternal (string projectFile,
|
||||
string[] targetNames,
|
||||
BuildPropertyGroup globalProperties,
|
||||
IDictionary targetOutputs,
|
||||
BuildSettings buildFlags, string toolsVersion)
|
||||
{
|
||||
|
||||
if ((buildFlags & BuildSettings.DoNotResetPreviouslyBuiltTargets) != BuildSettings.DoNotResetPreviouslyBuiltTargets)
|
||||
builtTargetsOutputByName.Clear ();
|
||||
|
||||
@@ -308,8 +336,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 +358,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
project.CheckUnloaded ();
|
||||
|
||||
if (project.FullFileName != String.Empty)
|
||||
projects.Remove (project.FullFileName);
|
||||
RemoveLoadedProject (project);
|
||||
|
||||
project.Unload ();
|
||||
}
|
||||
@@ -364,12 +393,25 @@ namespace Microsoft.Build.BuildEngine {
|
||||
loggers.Clear ();
|
||||
}
|
||||
|
||||
internal void StartProjectBuild (Project project, string [] target_names)
|
||||
void StartEngineBuild ()
|
||||
{
|
||||
if (!buildStarted) {
|
||||
LogBuildStarted ();
|
||||
buildStarted = true;
|
||||
}
|
||||
}
|
||||
|
||||
void EndEngineBuild (bool succeeded)
|
||||
{
|
||||
if (buildStarted && currentlyBuildingProjectsStack.Count == 0) {
|
||||
LogBuildFinished (succeeded);
|
||||
buildStarted = false;
|
||||
}
|
||||
}
|
||||
|
||||
internal void StartProjectBuild (Project project, string [] target_names)
|
||||
{
|
||||
StartEngineBuild ();
|
||||
|
||||
if (currentlyBuildingProjectsStack.Count == 0 ||
|
||||
String.Compare (currentlyBuildingProjectsStack.Peek ().FullFileName, project.FullFileName) != 0)
|
||||
@@ -395,10 +437,15 @@ namespace Microsoft.Build.BuildEngine {
|
||||
String.Compare (top_project.FullFileName, currentlyBuildingProjectsStack.Peek ().FullFileName) != 0)
|
||||
LogProjectFinished (top_project, succeeded);
|
||||
|
||||
if (currentlyBuildingProjectsStack.Count == 0) {
|
||||
LogBuildFinished (succeeded);
|
||||
buildStarted = false;
|
||||
}
|
||||
EndEngineBuild (succeeded);
|
||||
}
|
||||
|
||||
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)
|
||||
@@ -508,16 +555,14 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
public string DefaultToolsVersion {
|
||||
get {
|
||||
if (String.IsNullOrEmpty (defaultToolsVersion))
|
||||
#if NET_4_0
|
||||
return "4.0";
|
||||
#elif NET_3_5
|
||||
return "3.5";
|
||||
#else
|
||||
return "2.0";
|
||||
#endif
|
||||
|
||||
return defaultToolsVersion;
|
||||
// This is used as the fall back version if the
|
||||
// project can't find a version to use
|
||||
// Hard-coded to 2.0, so it allows even vs2005 projects
|
||||
// to build correctly, as they won't have a ToolsVersion
|
||||
// set!
|
||||
return String.IsNullOrEmpty (defaultToolsVersion)
|
||||
? "2.0"
|
||||
: defaultToolsVersion;
|
||||
}
|
||||
set {
|
||||
if (Toolsets [value] == null)
|
||||
|
||||
@@ -57,69 +57,87 @@ namespace Microsoft.Build.BuildEngine {
|
||||
{
|
||||
if (customEventRaised != null)
|
||||
customEventRaised (sender, cbea);
|
||||
FireAnyEvent (sender, cbea);
|
||||
}
|
||||
public void FireErrorRaised (object sender, BuildErrorEventArgs beea)
|
||||
{
|
||||
if (errorRaised != null)
|
||||
errorRaised (sender, beea);
|
||||
FireAnyEvent (sender, beea);
|
||||
}
|
||||
public void FireMessageRaised (object sender, BuildMessageEventArgs bmea)
|
||||
{
|
||||
if (messageRaised != null)
|
||||
messageRaised (sender, bmea);
|
||||
FireAnyEvent (sender, bmea);
|
||||
}
|
||||
public void FireWarningRaised (object sender, BuildWarningEventArgs bwea)
|
||||
{
|
||||
if (warningRaised != null)
|
||||
warningRaised (sender, bwea);
|
||||
FireAnyEvent (sender, bwea);
|
||||
}
|
||||
|
||||
public void FireTargetStarted (object sender, TargetStartedEventArgs tsea)
|
||||
{
|
||||
if (targetStarted != null)
|
||||
targetStarted (sender, tsea);
|
||||
FireAnyEvent (sender, tsea);
|
||||
}
|
||||
|
||||
public void FireTargetFinished (object sender, TargetFinishedEventArgs tfea)
|
||||
{
|
||||
if (targetFinished != null)
|
||||
targetFinished (sender, tfea);
|
||||
FireAnyEvent (sender, tfea);
|
||||
}
|
||||
|
||||
public void FireBuildStarted (object sender, BuildStartedEventArgs bsea)
|
||||
{
|
||||
if (buildStarted != null)
|
||||
buildStarted (sender, bsea);
|
||||
FireAnyEvent (sender, bsea);
|
||||
}
|
||||
|
||||
public void FireBuildFinished (object sender, BuildFinishedEventArgs bfea)
|
||||
{
|
||||
if (buildFinished != null)
|
||||
buildFinished (sender, bfea);
|
||||
FireAnyEvent (sender, bfea);
|
||||
}
|
||||
|
||||
public void FireProjectStarted (object sender, ProjectStartedEventArgs psea)
|
||||
{
|
||||
if (projectStarted != null)
|
||||
projectStarted (sender, psea);
|
||||
FireAnyEvent (sender, psea);
|
||||
}
|
||||
|
||||
public void FireProjectFinished (object sender, ProjectFinishedEventArgs pfea)
|
||||
{
|
||||
if (projectFinished != null)
|
||||
projectFinished (sender, pfea);
|
||||
FireAnyEvent (sender, pfea);
|
||||
}
|
||||
|
||||
public void FireTaskStarted (object sender, TaskStartedEventArgs tsea)
|
||||
{
|
||||
if (taskStarted != null)
|
||||
taskStarted (sender, tsea);
|
||||
FireAnyEvent (sender, tsea);
|
||||
}
|
||||
|
||||
public void FireTaskFinished (object sender, TaskFinishedEventArgs tfea)
|
||||
{
|
||||
if (taskFinished != null)
|
||||
taskFinished (sender, tfea);
|
||||
FireAnyEvent (sender, tfea);
|
||||
}
|
||||
|
||||
public void FireAnyEvent (object sender, BuildEventArgs bea)
|
||||
{
|
||||
if (anyEventRaised != null)
|
||||
anyEventRaised (sender, bea);
|
||||
}
|
||||
|
||||
public event AnyEventHandler AnyEventRaised {
|
||||
@@ -283,4 +301,4 @@ namespace Microsoft.Build.BuildEngine {
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -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 {
|
||||
|
||||
@@ -65,6 +66,20 @@ namespace Microsoft.Build.BuildEngine {
|
||||
this.expressionCollection = new ExpressionCollection ();
|
||||
}
|
||||
|
||||
public static T ParseAs<T> (string expression, ParseOptions options, Project project)
|
||||
{
|
||||
Expression expr = new Expression ();
|
||||
expr.Parse (expression, options);
|
||||
return (T)expr.ConvertTo (project, typeof (T));
|
||||
}
|
||||
|
||||
public static T ParseAs<T> (string expression, ParseOptions options, Project project, ExpressionOptions exprOptions)
|
||||
{
|
||||
Expression expr = new Expression ();
|
||||
expr.Parse (expression, options);
|
||||
return (T)expr.ConvertTo (project, typeof (T), exprOptions);
|
||||
}
|
||||
|
||||
// Split: Split on ';'
|
||||
// Eg. Property values don't need to be split
|
||||
//
|
||||
@@ -131,7 +146,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
|
||||
@@ -3,8 +3,10 @@
|
||||
//
|
||||
// Author:
|
||||
// Marek Sieradzki ([email protected])
|
||||
// Ankit Jain ([email protected])
|
||||
//
|
||||
// (C) 2005 Marek Sieradzki
|
||||
// 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
|
||||
@@ -27,23 +29,125 @@
|
||||
|
||||
#if NET_2_0
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Microsoft.Build.Framework;
|
||||
|
||||
namespace Microsoft.Build.BuildEngine {
|
||||
public class FileLogger : ConsoleLogger {
|
||||
StreamWriter sw;
|
||||
string logfile;
|
||||
string encoding = null;
|
||||
IEventSource eventSource;
|
||||
|
||||
public FileLogger ()
|
||||
{
|
||||
base.Verbosity = LoggerVerbosity.Detailed;
|
||||
}
|
||||
|
||||
// FIXME: add our handlers to the events
|
||||
public override void Initialize (IEventSource eventSource)
|
||||
{
|
||||
this.eventSource = eventSource;
|
||||
logfile = "msbuild.log";
|
||||
|
||||
bool append = false;
|
||||
string key, value;
|
||||
string[] splittedParameters = Parameters.Split (new char [] {';'}, StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach (string s in splittedParameters) {
|
||||
if (String.Compare (s, "Append") == 0) {
|
||||
append = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (s.StartsWith ("Encoding")) {
|
||||
if (!TrySplitKeyValuePair (s, out key, out value))
|
||||
throw new LoggerException ("Encoding should be specified as: Encoding=<encoding>, eg. Encoding=UTF-8");
|
||||
|
||||
if (String.IsNullOrEmpty (value))
|
||||
throw new LoggerException ("Encoding must be non-empty");
|
||||
|
||||
encoding = value;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (s.StartsWith ("LogFile")) {
|
||||
if (!TrySplitKeyValuePair (s, out key, out value))
|
||||
throw new LoggerException ("LogFile should be specified as: LogFile=<encoding>, eg. LogFile=foo.log");
|
||||
|
||||
if (String.IsNullOrEmpty (value))
|
||||
throw new LoggerException ("LogFile value must be non-empty");
|
||||
|
||||
logfile = value;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Attach *our* HandleBuildStarted as the first one,
|
||||
// as it needs to create the writer!
|
||||
eventSource.BuildStarted += HandleBuildStarted;
|
||||
base.Initialize (eventSource);
|
||||
// Attach *our* HandleBuildFinished as the last one,
|
||||
// as it needs to close the writer!
|
||||
eventSource.BuildFinished += HandleBuildFinished;
|
||||
|
||||
CreateWriter (append);
|
||||
}
|
||||
|
||||
void CreateWriter (bool append_to)
|
||||
{
|
||||
if (sw != null)
|
||||
return;
|
||||
|
||||
if (!String.IsNullOrEmpty (encoding))
|
||||
sw = new StreamWriter (logfile, append_to, Encoding.GetEncoding (encoding));
|
||||
else
|
||||
sw = new StreamWriter (logfile, append_to, Encoding.Default);
|
||||
WriteHandler = sw.WriteLine;
|
||||
}
|
||||
|
||||
void HandleBuildStarted (object sender, BuildStartedEventArgs args)
|
||||
{
|
||||
CreateWriter (true);
|
||||
}
|
||||
|
||||
void HandleBuildFinished (object sender, BuildFinishedEventArgs args)
|
||||
{
|
||||
base.WriteHandler = null;
|
||||
if (sw != null) {
|
||||
sw.Close ();
|
||||
sw = null;
|
||||
}
|
||||
}
|
||||
|
||||
bool TrySplitKeyValuePair (string pair, out string key, out string value)
|
||||
{
|
||||
key = value = null;
|
||||
string[] parts = pair.Split ('=');
|
||||
if (parts.Length != 2)
|
||||
return false;
|
||||
|
||||
key = parts [0];
|
||||
value = parts [1];
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Shutdown ()
|
||||
{
|
||||
base.WriteHandler = null;
|
||||
if (sw != null) {
|
||||
sw.Close ();
|
||||
sw = null;
|
||||
}
|
||||
|
||||
if (eventSource != null) {
|
||||
eventSource.BuildStarted -= HandleBuildStarted;
|
||||
eventSource.BuildFinished -= HandleBuildFinished;
|
||||
}
|
||||
|
||||
base.Shutdown ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#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 ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
//
|
||||
// Author:
|
||||
// Marek Sieradzki ([email protected])
|
||||
// Ankit Jain ([email protected])
|
||||
//
|
||||
// (C) 2006 Marek Sieradzki
|
||||
// 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
|
||||
@@ -28,10 +30,14 @@
|
||||
#if NET_2_0
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml;
|
||||
|
||||
using Microsoft.Build.Framework;
|
||||
using Microsoft.Build.Utilities;
|
||||
using Mono.XBuild.Utilities;
|
||||
|
||||
namespace Microsoft.Build.BuildEngine {
|
||||
public class Import {
|
||||
@@ -43,8 +49,14 @@ 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)
|
||||
: this (importElement, null, project, originalProject)
|
||||
{}
|
||||
|
||||
// if @alternateProjectPath is available then that it used as the EvaluatedProjectPath!
|
||||
internal Import (XmlElement importElement, string alternateProjectPath, Project project, ImportedProject originalProject)
|
||||
{
|
||||
if (importElement == null)
|
||||
throw new ArgumentNullException ("importElement");
|
||||
@@ -59,7 +71,8 @@ namespace Microsoft.Build.BuildEngine {
|
||||
throw new InvalidProjectFileException ("The required attribute \"Project\" is missing from element <Import>.");
|
||||
|
||||
if (ConditionParser.ParseAndEvaluate (Condition, project)) {
|
||||
evaluatedProjectPath = EvaluateProjectPath (ProjectPath);
|
||||
evaluatedProjectPath = String.IsNullOrEmpty (alternateProjectPath) ? EvaluateProjectPath (ProjectPath) : alternateProjectPath;
|
||||
|
||||
evaluatedProjectPath = GetFullPath ();
|
||||
if (EvaluatedProjectPath == String.Empty)
|
||||
throw new InvalidProjectFileException ("The required attribute \"Project\" is missing from element <Import>.");
|
||||
@@ -71,9 +84,9 @@ namespace Microsoft.Build.BuildEngine {
|
||||
{
|
||||
string filename = evaluatedProjectPath;
|
||||
// NOTE: it's a hack to transform Microsoft.CSharp.Targets to Microsoft.CSharp.targets
|
||||
if (Path.HasExtension (filename))
|
||||
filename = Path.ChangeExtension (filename, Path.GetExtension (filename));
|
||||
|
||||
if (!File.Exists (filename) && Path.GetFileName (filename) == "Microsoft.CSharp.Targets")
|
||||
filename = Path.ChangeExtension (filename, ".targets");
|
||||
|
||||
if (!File.Exists (filename)) {
|
||||
if (ignoreMissingImports) {
|
||||
project.LogWarning (project.FullFileName, "Could not find project file {0}, to import. Ignoring.", filename);
|
||||
@@ -91,91 +104,148 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
string EvaluateProjectPath (string file)
|
||||
{
|
||||
string ret;
|
||||
if (EvaluateAsMSBuildExtensionsPath (file, "MSBuildExtensionsPath", out ret) ||
|
||||
EvaluateAsMSBuildExtensionsPath (file, "MSBuildExtensionsPath32", out ret) ||
|
||||
EvaluateAsMSBuildExtensionsPath (file, "MSBuildExtensionsPath64", out ret))
|
||||
return ret;
|
||||
|
||||
return EvaluatePath (file);
|
||||
}
|
||||
|
||||
bool EvaluateAsMSBuildExtensionsPath (string file, string property_name, out string epath)
|
||||
{
|
||||
epath = null;
|
||||
string property_ref = String.Format ("$({0})", property_name);
|
||||
if (file.IndexOf (property_ref) < 0)
|
||||
return false;
|
||||
|
||||
// This is a *HACK* to support multiple paths for
|
||||
// MSBuildExtensionsPath property. Normally it would
|
||||
// get resolved to a single value, but here we special
|
||||
// case it and try ~/.config/xbuild/tasks and any
|
||||
// paths specified in the env var $MSBuildExtensionsPath .
|
||||
//
|
||||
// The property itself will resolve to the default
|
||||
// location though, so you get in any other part of the
|
||||
// project.
|
||||
|
||||
string envvar = Environment.GetEnvironmentVariable (property_name);
|
||||
envvar = String.Join (":", new string [] {
|
||||
// For mac osx, look in the 'External' dir on macosx,
|
||||
// see bug #663180
|
||||
Microsoft.Build.Tasks.Utilities.RunningOnMac ? MacOSXExternalXBuildDir : String.Empty,
|
||||
(envvar ?? String.Empty),
|
||||
DotConfigExtensionsPath});
|
||||
|
||||
string [] paths = envvar.Split (new char [] {':'}, StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach (string path in paths) {
|
||||
if (!Directory.Exists (path)) {
|
||||
project.ParentEngine.LogMessage (MessageImportance.Low, "Extension path '{0}' not found, ignoring.", path);
|
||||
continue;
|
||||
}
|
||||
|
||||
string pfile = Path.GetFullPath (file.Replace ("\\", "/").Replace (
|
||||
property_ref, path + Path.DirectorySeparatorChar));
|
||||
|
||||
var evaluated_path = EvaluatePath (pfile);
|
||||
if (File.Exists (evaluated_path)) {
|
||||
project.ParentEngine.LogMessage (MessageImportance.Low,
|
||||
"{0}: Importing project {1} from extension path {2}", project.FullFileName, evaluated_path, path);
|
||||
epath = pfile;
|
||||
return true;
|
||||
}
|
||||
project.ParentEngine.LogMessage (MessageImportance.Low,
|
||||
"{0}: Couldn't find project {1} for extension path {2}", project.FullFileName, evaluated_path, path);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
string EvaluatePath (string path)
|
||||
{
|
||||
var exp = new Expression ();
|
||||
exp.Parse (path, ParseOptions.Split);
|
||||
return (string) exp.ConvertTo (project, typeof (string));
|
||||
return Expression.ParseAs<string> (file, ParseOptions.Split, project);
|
||||
}
|
||||
|
||||
string GetFullPath ()
|
||||
{
|
||||
string file = EvaluatedProjectPath;
|
||||
if (!Path.IsPathRooted (file) && !String.IsNullOrEmpty (ContainedInProjectFileName))
|
||||
file = Path.Combine (Path.GetDirectoryName (ContainedInProjectFileName), file);
|
||||
|
||||
if (!Path.IsPathRooted (EvaluatedProjectPath)) {
|
||||
string dir = null;
|
||||
if (originalProject == null) {
|
||||
if (project.FullFileName != String.Empty) // Path.GetDirectoryName throws exception on String.Empty
|
||||
dir = Path.GetDirectoryName (project.FullFileName);
|
||||
} else {
|
||||
if (originalProject.FullFileName != String.Empty)
|
||||
dir = Path.GetDirectoryName (originalProject.FullFileName);
|
||||
}
|
||||
if (dir != null)
|
||||
file = Path.Combine (dir, EvaluatedProjectPath);
|
||||
}
|
||||
|
||||
return Utilities.FromMSBuildPath (file);
|
||||
return MSBuildUtils.FromMSBuildPath (file);
|
||||
}
|
||||
|
||||
|
||||
// For every extension path, in order, finds suitable
|
||||
// import filename(s) matching the Import, and calls
|
||||
// @func with them
|
||||
//
|
||||
// func: bool func(importPath, from_source_msg)
|
||||
//
|
||||
// If for an extension path, atleast one file gets imported,
|
||||
// then it stops at that.
|
||||
// So, in case imports like "$(MSBuildExtensionsPath)\foo\*",
|
||||
// for every extension path, it will try to import the "foo\*",
|
||||
// and if atleast one file gets successfully imported, then it
|
||||
// stops at that
|
||||
internal static void ForEachExtensionPathTillFound (XmlElement xmlElement, Project project, ImportedProject importingProject,
|
||||
Func<string, string, bool> func)
|
||||
{
|
||||
string project_attribute = xmlElement.GetAttribute ("Project");
|
||||
string condition_attribute = xmlElement.GetAttribute ("Condition");
|
||||
|
||||
bool has_extn_ref = project_attribute.IndexOf ("$(MSBuildExtensionsPath)") >= 0 ||
|
||||
project_attribute.IndexOf ("$(MSBuildExtensionsPath32)") >= 0 ||
|
||||
project_attribute.IndexOf ("$(MSBuildExtensionsPath64)") >= 0;
|
||||
|
||||
string importingFile = importingProject != null ? importingProject.FullFileName : project.FullFileName;
|
||||
DirectoryInfo base_dir_info = null;
|
||||
if (!String.IsNullOrEmpty (importingFile))
|
||||
base_dir_info = new DirectoryInfo (Path.GetDirectoryName (importingFile));
|
||||
else
|
||||
base_dir_info = new DirectoryInfo (Directory.GetCurrentDirectory ());
|
||||
|
||||
IEnumerable<string> extn_paths = has_extn_ref ? GetExtensionPaths (project) : new string [] {null};
|
||||
try {
|
||||
foreach (string path in extn_paths) {
|
||||
string extn_msg = null;
|
||||
if (has_extn_ref) {
|
||||
project.SetExtensionsPathProperties (path);
|
||||
extn_msg = "from extension path " + path;
|
||||
}
|
||||
|
||||
// do this after setting new Extension properties, as condition might
|
||||
// reference it
|
||||
if (!ConditionParser.ParseAndEvaluate (condition_attribute, project))
|
||||
continue;
|
||||
|
||||
// We stop if atleast one file got imported.
|
||||
// Remaining extension paths are *not* tried
|
||||
bool atleast_one = false;
|
||||
foreach (string importPath in GetImportPathsFromString (project_attribute, project, base_dir_info)) {
|
||||
try {
|
||||
if (func (importPath, extn_msg))
|
||||
atleast_one = true;
|
||||
} catch (Exception e) {
|
||||
throw new InvalidProjectFileException (String.Format (
|
||||
"{0}: Project file could not be imported, it was being imported by " +
|
||||
"{1}: {2}", importPath, importingFile, e.Message), e);
|
||||
}
|
||||
}
|
||||
|
||||
if (atleast_one)
|
||||
return;
|
||||
}
|
||||
} finally {
|
||||
if (has_extn_ref)
|
||||
project.SetExtensionsPathProperties (Project.DefaultExtensionsPath);
|
||||
}
|
||||
}
|
||||
|
||||
// Parses the Project attribute from an Import,
|
||||
// and returns the import filenames that match.
|
||||
// This handles wildcards also
|
||||
static IEnumerable<string> GetImportPathsFromString (string import_string, Project project, DirectoryInfo base_dir_info)
|
||||
{
|
||||
string parsed_import = Expression.ParseAs<string> (import_string, ParseOptions.AllowItemsNoMetadataAndSplit, project);
|
||||
if (parsed_import != null)
|
||||
parsed_import = parsed_import.Trim ();
|
||||
|
||||
if (String.IsNullOrEmpty (parsed_import))
|
||||
throw new InvalidProjectFileException ("The required attribute \"Project\" in Import is empty");
|
||||
|
||||
#if NET_4_0
|
||||
if (DirectoryScanner.HasWildcard (parsed_import)) {
|
||||
var directoryScanner = new DirectoryScanner () {
|
||||
Includes = new ITaskItem [] { new TaskItem (parsed_import) },
|
||||
BaseDirectory = base_dir_info
|
||||
};
|
||||
directoryScanner.Scan ();
|
||||
|
||||
foreach (ITaskItem matchedItem in directoryScanner.MatchedItems)
|
||||
yield return matchedItem.ItemSpec;
|
||||
} else
|
||||
#endif
|
||||
yield return parsed_import;
|
||||
}
|
||||
|
||||
// Gives a list of extensions paths to try for $(MSBuildExtensionsPath),
|
||||
// *in-order*
|
||||
static IEnumerable<string> GetExtensionPaths (Project project)
|
||||
{
|
||||
// This is a *HACK* to support multiple paths for
|
||||
// MSBuildExtensionsPath property. Normally it would
|
||||
// get resolved to a single value, but here we special
|
||||
// case it and try various paths, see the code below
|
||||
//
|
||||
// The property itself will resolve to the default
|
||||
// location though, so you get that in any other part of the
|
||||
// project.
|
||||
|
||||
string envvar = Environment.GetEnvironmentVariable ("MSBuildExtensionsPath");
|
||||
envvar = String.Join (PathSeparatorAsString, new string [] {
|
||||
(envvar ?? String.Empty),
|
||||
// For mac osx, look in the 'External' dir on macosx,
|
||||
// see bug #663180
|
||||
MSBuildUtils.RunningOnMac ? MacOSXExternalXBuildDir : String.Empty,
|
||||
DotConfigExtensionsPath,
|
||||
Project.DefaultExtensionsPath});
|
||||
|
||||
var pathsTable = new Dictionary<string, string> ();
|
||||
foreach (string extn_path in envvar.Split (new char [] {Path.PathSeparator}, StringSplitOptions.RemoveEmptyEntries)) {
|
||||
if (pathsTable.ContainsKey (extn_path))
|
||||
continue;
|
||||
|
||||
if (!Directory.Exists (extn_path)) {
|
||||
project.ParentEngine.LogMessage (MessageImportance.Low, "Extension path '{0}' not found, ignoring.", extn_path);
|
||||
continue;
|
||||
}
|
||||
|
||||
pathsTable [extn_path] = extn_path;
|
||||
yield return extn_path;
|
||||
}
|
||||
}
|
||||
|
||||
public string Condition {
|
||||
get {
|
||||
string s = importElement.GetAttribute ("Condition");
|
||||
@@ -194,6 +264,10 @@ namespace Microsoft.Build.BuildEngine {
|
||||
public string ProjectPath {
|
||||
get { return importElement.GetAttribute ("Project"); }
|
||||
}
|
||||
|
||||
internal string ContainedInProjectFileName {
|
||||
get { return originalProject != null ? originalProject.FullFileName : project.FullFileName; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,19 +37,19 @@ namespace Microsoft.Build.BuildEngine {
|
||||
public class ImportCollection : ICollection, IEnumerable {
|
||||
|
||||
GroupingCollection groupingCollection;
|
||||
Dictionary <string, object> filenames;
|
||||
Dictionary <string, Import> filenames;
|
||||
|
||||
internal ImportCollection (GroupingCollection groupingCollection)
|
||||
{
|
||||
this.groupingCollection = groupingCollection;
|
||||
filenames = new Dictionary <string, object> ();
|
||||
filenames = new Dictionary <string, Import> ();
|
||||
}
|
||||
|
||||
internal void Add (Import import)
|
||||
{
|
||||
if (!filenames.ContainsKey (import.EvaluatedProjectPath)) {
|
||||
groupingCollection.Add (import);
|
||||
filenames.Add (import.EvaluatedProjectPath, null);
|
||||
filenames.Add (import.EvaluatedProjectPath, import);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,6 +77,11 @@ namespace Microsoft.Build.BuildEngine {
|
||||
{
|
||||
return filenames.ContainsKey (import.EvaluatedProjectPath);
|
||||
}
|
||||
|
||||
internal bool TryGetImport (Import keyImport, out Import valueImport)
|
||||
{
|
||||
return filenames.TryGetValue (keyImport.EvaluatedProjectPath, out valueImport);
|
||||
}
|
||||
|
||||
public void CopyTo (Import[] array, int index)
|
||||
{
|
||||
|
||||
@@ -57,9 +57,6 @@ namespace Microsoft.Build.BuildEngine {
|
||||
lastWrite = File.GetLastWriteTime (filename);
|
||||
fullFileName = filename;
|
||||
}
|
||||
catch (Exception) {
|
||||
throw;
|
||||
}
|
||||
finally {
|
||||
sr.Close ();
|
||||
}
|
||||
|
||||
@@ -47,15 +47,21 @@ namespace Microsoft.Build.BuildEngine
|
||||
else
|
||||
return String.Format (unformatted, args);
|
||||
}
|
||||
|
||||
|
||||
public static void LogError (this Engine engine, string message,
|
||||
params object[] messageArgs)
|
||||
{
|
||||
engine.LogErrorWithFilename (null, message, messageArgs);
|
||||
}
|
||||
|
||||
public static void LogErrorWithFilename (this Engine engine, string filename, string message,
|
||||
params object[] messageArgs)
|
||||
{
|
||||
if (message == null)
|
||||
throw new ArgumentNullException ("message");
|
||||
|
||||
BuildErrorEventArgs beea = new BuildErrorEventArgs (
|
||||
null, null, null, 0, 0, 0, 0, FormatString (message, messageArgs),
|
||||
null, null, filename, 0, 0, 0, 0, FormatString (message, messageArgs),
|
||||
null, null);
|
||||
engine.EventSource.FireErrorRaised (engine, beea);
|
||||
}
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
//
|
||||
// Author:
|
||||
// Marek Sieradzki ([email protected])
|
||||
// Ankit Jain ([email protected])
|
||||
//
|
||||
// (C) 2005 Marek Sieradzki
|
||||
// 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
|
||||
@@ -32,6 +34,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
@@ -73,10 +76,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 +118,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)
|
||||
@@ -137,8 +144,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
if (!String.IsNullOrEmpty (importCondition))
|
||||
importElement.SetAttribute ("Condition", importCondition);
|
||||
|
||||
Import import = new Import (importElement, this, null);
|
||||
imports.Add (import);
|
||||
AddImport (importElement, null, false);
|
||||
MarkProjectAsDirty ();
|
||||
NeedToReevaluate ();
|
||||
}
|
||||
@@ -270,7 +276,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
{
|
||||
return Build (targetNames, targetOutputs, BuildSettings.None);
|
||||
}
|
||||
|
||||
|
||||
[MonoTODO ("Not tested")]
|
||||
public bool Build (string [] targetNames,
|
||||
IDictionary targetOutputs,
|
||||
@@ -279,6 +285,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;
|
||||
@@ -286,6 +297,13 @@ namespace Microsoft.Build.BuildEngine {
|
||||
Directory.SetCurrentDirectory (Path.GetDirectoryName (fullFileName));
|
||||
building = true;
|
||||
result = BuildInternal (targetNames, targetOutputs, buildFlags);
|
||||
} catch (InvalidProjectFileException ie) {
|
||||
ParentEngine.LogErrorWithFilename (fullFileName, ie.Message);
|
||||
ParentEngine.LogMessage (MessageImportance.Low, String.Format ("{0}: {1}", fullFileName, ie.ToString ()));
|
||||
} catch (Exception e) {
|
||||
ParentEngine.LogErrorWithFilename (fullFileName, e.Message);
|
||||
ParentEngine.LogMessage (MessageImportance.Low, String.Format ("{0}: {1}", fullFileName, e.ToString ()));
|
||||
throw;
|
||||
} finally {
|
||||
ParentEngine.EndProjectBuild (this, result);
|
||||
current_settings = BuildSettings.None;
|
||||
@@ -301,16 +319,28 @@ namespace Microsoft.Build.BuildEngine {
|
||||
BuildSettings buildFlags)
|
||||
{
|
||||
CheckUnloaded ();
|
||||
if (buildFlags == BuildSettings.None)
|
||||
if (buildFlags == BuildSettings.None) {
|
||||
needToReevaluate = false;
|
||||
Reevaluate ();
|
||||
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
ProcessBeforeAndAfterTargets ();
|
||||
#endif
|
||||
|
||||
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) {
|
||||
@@ -321,9 +351,13 @@ namespace Microsoft.Build.BuildEngine {
|
||||
initialTargetsBuilt = true;
|
||||
}
|
||||
|
||||
foreach (string target in targetNames)
|
||||
foreach (string target in targetNames) {
|
||||
if (target == null)
|
||||
throw new ArgumentNullException ("Target name cannot be null");
|
||||
|
||||
if (!BuildTarget (target.Trim (), targetOutputs))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -351,9 +385,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)
|
||||
@@ -364,6 +405,44 @@ namespace Microsoft.Build.BuildEngine {
|
||||
return sb.ToString ();
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
void ProcessBeforeAndAfterTargets ()
|
||||
{
|
||||
var beforeTable = Targets.AsIEnumerable ()
|
||||
.SelectMany (target => GetTargetNamesFromString (target.BeforeTargets),
|
||||
(target, before_target) => new {before_target, name = target.Name})
|
||||
.ToLookup (x => x.before_target, x => x.name)
|
||||
.ToDictionary (x => x.Key, x => x.Distinct ().ToList ());
|
||||
|
||||
foreach (var pair in beforeTable) {
|
||||
if (targets.Exists (pair.Key))
|
||||
targets [pair.Key].BeforeThisTargets = pair.Value;
|
||||
else
|
||||
LogWarning (FullFileName, "Target '{0}', not found in the project", pair.Key);
|
||||
}
|
||||
|
||||
var afterTable = Targets.AsIEnumerable ()
|
||||
.SelectMany (target => GetTargetNamesFromString (target.AfterTargets),
|
||||
(target, after_target) => new {after_target, name = target.Name})
|
||||
.ToLookup (x => x.after_target, x => x.name)
|
||||
.ToDictionary (x => x.Key, x => x.Distinct ().ToList ());
|
||||
|
||||
foreach (var pair in afterTable) {
|
||||
if (targets.Exists (pair.Key))
|
||||
targets [pair.Key].AfterThisTargets = pair.Value;
|
||||
else
|
||||
LogWarning (FullFileName, "Target '{0}', not found in the project", pair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
string[] GetTargetNamesFromString (string targets)
|
||||
{
|
||||
Expression expr = new Expression ();
|
||||
expr.Parse (targets, ParseOptions.AllowItemsNoMetadataAndSplit);
|
||||
return (string []) expr.ConvertTo (this, typeof (string []));
|
||||
}
|
||||
#endif
|
||||
|
||||
[MonoTODO]
|
||||
public string [] GetConditionedPropertyValues (string propertyName)
|
||||
{
|
||||
@@ -445,10 +524,12 @@ 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) {
|
||||
Project tmp_project = ParentEngine.CreateNewProject ();
|
||||
tmp_project.FullFileName = filename;
|
||||
SolutionParser sln_parser = new SolutionParser ();
|
||||
sln_parser.ParseSolution (fullFileName, tmp_project, delegate (int errorNumber, string message) {
|
||||
LogWarning (filename, message);
|
||||
@@ -798,7 +879,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));
|
||||
|
||||
@@ -854,7 +935,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
AddUsingTask (xe, ip);
|
||||
break;
|
||||
case "Import":
|
||||
AddImport (xe, ip);
|
||||
AddImport (xe, ip, true);
|
||||
break;
|
||||
case "ItemGroup":
|
||||
AddItemGroup (xe, ip);
|
||||
@@ -863,7 +944,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 +977,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)
|
||||
@@ -905,10 +985,11 @@ namespace Microsoft.Build.BuildEngine {
|
||||
BuildProperty bp;
|
||||
|
||||
evaluatedProperties = new BuildPropertyGroup (null, null, null, true);
|
||||
conditionedProperties = new Dictionary<string, List<string>> ();
|
||||
|
||||
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 +998,37 @@ 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 ("MSBuildToolsRoot", Path.GetDirectoryName (toolsPath), PropertyType.Reserved));
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildToolsVersion", effective_tools_version, PropertyType.Reserved));
|
||||
SetExtensionsPathProperties (DefaultExtensionsPath);
|
||||
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 +1037,28 @@ 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 ());
|
||||
}
|
||||
|
||||
internal void SetExtensionsPathProperties (string extn_path)
|
||||
{
|
||||
if (!String.IsNullOrEmpty (extn_path)) {
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildExtensionsPath", extn_path, PropertyType.Reserved));
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildExtensionsPath32", extn_path, PropertyType.Reserved));
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildExtensionsPath64", extn_path, PropertyType.Reserved));
|
||||
}
|
||||
}
|
||||
|
||||
// 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 +1067,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;
|
||||
}
|
||||
@@ -1005,23 +1100,52 @@ namespace Microsoft.Build.BuildEngine {
|
||||
usingTask = new UsingTask (xmlElement, this, importedProject);
|
||||
UsingTasks.Add (usingTask);
|
||||
}
|
||||
|
||||
void AddImport (XmlElement xmlElement, ImportedProject importingProject)
|
||||
|
||||
void AddImport (XmlElement xmlElement, ImportedProject importingProject, bool evaluate_properties)
|
||||
{
|
||||
// eval all the properties etc till the import
|
||||
groupingCollection.Evaluate (EvaluationType.Property);
|
||||
if (evaluate_properties)
|
||||
groupingCollection.Evaluate (EvaluationType.Property);
|
||||
|
||||
Import import = new Import (xmlElement, this, importingProject);
|
||||
if (!ConditionParser.ParseAndEvaluate (import.Condition, this))
|
||||
return;
|
||||
try {
|
||||
PushThisFileProperty (importingProject != null ? importingProject.FullFileName : FullFileName);
|
||||
|
||||
if (Imports.Contains (import)) {
|
||||
LogWarning (importingProject != null ? importingProject.FullFileName : fullFileName,
|
||||
"A circular reference was found involving the import of {0}. Only" +
|
||||
" the first import of this file will be used, ignoring others.",
|
||||
import.ProjectPath);
|
||||
string project_attribute = xmlElement.GetAttribute ("Project");
|
||||
if (String.IsNullOrEmpty (project_attribute))
|
||||
throw new InvalidProjectFileException ("The required attribute \"Project\" is missing from element <Import>.");
|
||||
|
||||
return;
|
||||
Import.ForEachExtensionPathTillFound (xmlElement, this, importingProject,
|
||||
(importPath, from_source_msg) => AddSingleImport (xmlElement, importPath, importingProject, from_source_msg));
|
||||
} finally {
|
||||
PopThisFileProperty ();
|
||||
}
|
||||
}
|
||||
|
||||
bool AddSingleImport (XmlElement xmlElement, string projectPath, ImportedProject importingProject, string from_source_msg)
|
||||
{
|
||||
Import import = new Import (xmlElement, projectPath, this, importingProject);
|
||||
if (!ConditionParser.ParseAndEvaluate (import.Condition, this)) {
|
||||
ParentEngine.LogMessage (MessageImportance.Low,
|
||||
"Not importing project '{0}' as the condition '{1}' is false",
|
||||
import.ProjectPath, import.Condition);
|
||||
return false;
|
||||
}
|
||||
|
||||
Import existingImport;
|
||||
if (Imports.TryGetImport (import, out existingImport)) {
|
||||
if (importingProject == null)
|
||||
LogWarning (fullFileName,
|
||||
"Cannot import project '{0}' again. It was already imported by " +
|
||||
"'{1}'. Ignoring.",
|
||||
projectPath, existingImport.ContainedInProjectFileName);
|
||||
else
|
||||
LogWarning (importingProject != null ? importingProject.FullFileName : fullFileName,
|
||||
"A circular reference was found involving the import of '{0}'. " +
|
||||
"It was earlier imported by '{1}'. Only " +
|
||||
"the first import of this file will be used, ignoring others.",
|
||||
import.EvaluatedProjectPath, existingImport.ContainedInProjectFileName);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (String.Compare (fullFileName, import.EvaluatedProjectPath) == 0) {
|
||||
@@ -1029,13 +1153,19 @@ namespace Microsoft.Build.BuildEngine {
|
||||
"The main project file was imported here, which creates a circular " +
|
||||
"reference. Ignoring this import.");
|
||||
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
Imports.Add (import);
|
||||
string importingFile = importingProject != null ? importingProject.FullFileName : FullFileName;
|
||||
ParentEngine.LogMessage (MessageImportance.Low,
|
||||
"{0}: Importing project {1} {2}",
|
||||
importingFile, import.EvaluatedProjectPath, from_source_msg);
|
||||
|
||||
import.Evaluate (project_load_settings == ProjectLoadSettings.IgnoreMissingImports);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void AddItemGroup (XmlElement xmlElement, ImportedProject importedProject)
|
||||
{
|
||||
BuildItemGroup big = new BuildItemGroup (xmlElement, this, importedProject, false);
|
||||
@@ -1048,9 +1178,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 +1373,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 (
|
||||
@@ -1260,7 +1425,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
ParentEngine.EventSource.FireErrorRaised (this, beea);
|
||||
}
|
||||
|
||||
static string ExtensionsPath {
|
||||
internal static string DefaultExtensionsPath {
|
||||
get {
|
||||
if (extensions_path == null) {
|
||||
// NOTE: code from mcs/tools/gacutil/driver.cs
|
||||
@@ -1396,10 +1561,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; }
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml;
|
||||
using Microsoft.Build.Framework;
|
||||
using Microsoft.Build.Utilities;
|
||||
@@ -122,6 +123,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;
|
||||
@@ -147,14 +158,15 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
try {
|
||||
buildState = BuildState.Started;
|
||||
result = BuildDependencies (GetDependencies (), out executeOnErrors);
|
||||
|
||||
if (!result && executeOnErrors)
|
||||
ExecuteOnErrors ();
|
||||
|
||||
if (result)
|
||||
// deps built fine, do main build
|
||||
result = DoBuild (out executeOnErrors);
|
||||
#if NET_4_0
|
||||
result = BuildDependencies (out executeOnErrors) &&
|
||||
BuildBeforeThisTargets (out executeOnErrors) &&
|
||||
DoBuild (out executeOnErrors) && // deps & Before targets built fine, do main build
|
||||
BuildAfterThisTargets (out executeOnErrors);
|
||||
#else
|
||||
result = BuildDependencies (out executeOnErrors) && DoBuild (out executeOnErrors);
|
||||
#endif
|
||||
|
||||
buildState = BuildState.Finished;
|
||||
} catch (Exception e) {
|
||||
@@ -164,42 +176,80 @@ namespace Microsoft.Build.BuildEngine {
|
||||
project.PopBatch ();
|
||||
}
|
||||
|
||||
project.ParentEngine.BuiltTargetsOutputByName [built_targets_key] = (ITaskItem[]) Outputs.Clone ();
|
||||
project.BuiltTargetKeys.Add (built_targets_key);
|
||||
ITaskItem[] outputs = (ITaskItem[]) OutputsAsITaskItems.Clone ();
|
||||
foreach (ITaskItem item in outputs) {
|
||||
item.SetMetadata ("MSBuildProjectFile", TargetFile);
|
||||
item.SetMetadata ("MSBuildTargetName", Name);
|
||||
}
|
||||
project.ParentEngine.BuiltTargetsOutputByName [built_targets_key] = outputs;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
List <Target> GetDependencies ()
|
||||
{
|
||||
List <Target> list = new List <Target> ();
|
||||
Target t;
|
||||
string [] targetNames;
|
||||
Expression deps;
|
||||
|
||||
if (DependsOnTargets != String.Empty) {
|
||||
deps = new Expression ();
|
||||
deps.Parse (DependsOnTargets, ParseOptions.AllowItemsNoMetadataAndSplit);
|
||||
targetNames = (string []) deps.ConvertTo (Project, typeof (string []));
|
||||
foreach (string dep_name in targetNames) {
|
||||
t = project.Targets [dep_name.Trim ()];
|
||||
if (t == null)
|
||||
throw new InvalidProjectFileException (String.Format (
|
||||
"Target '{0}', a dependency of target '{1}', not found.",
|
||||
dep_name.Trim (), Name));
|
||||
list.Add (t);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
bool BuildDependencies (List <Target> deps, out bool executeOnErrors)
|
||||
bool BuildDependencies (out bool executeOnErrors)
|
||||
{
|
||||
executeOnErrors = false;
|
||||
foreach (Target t in deps) {
|
||||
|
||||
if (String.IsNullOrEmpty (DependsOnTargets))
|
||||
return true;
|
||||
|
||||
var expr = new Expression ();
|
||||
expr.Parse (DependsOnTargets, ParseOptions.AllowItemsNoMetadataAndSplit);
|
||||
string [] targetNames = (string []) expr.ConvertTo (Project, typeof (string []));
|
||||
|
||||
bool result = BuildOtherTargets (targetNames,
|
||||
tname => engine.LogError ("Target '{0}', a dependency of target '{1}', not found.",
|
||||
tname, Name),
|
||||
out executeOnErrors);
|
||||
if (!result && executeOnErrors)
|
||||
ExecuteOnErrors ();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
bool BuildBeforeThisTargets (out bool executeOnErrors)
|
||||
{
|
||||
executeOnErrors = false;
|
||||
bool result = BuildOtherTargets (BeforeThisTargets, null, out executeOnErrors);
|
||||
if (!result && executeOnErrors)
|
||||
ExecuteOnErrors ();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool BuildAfterThisTargets (out bool executeOnErrors)
|
||||
{
|
||||
executeOnErrors = false;
|
||||
//missing_target handler not required as these are picked from actual target's
|
||||
//"Before/AfterTargets attributes!
|
||||
bool result = BuildOtherTargets (AfterThisTargets, null, out executeOnErrors);
|
||||
if (!result && executeOnErrors)
|
||||
ExecuteOnErrors ();
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool BuildOtherTargets (IEnumerable<string> targetNames, Action<string> missing_target, out bool executeOnErrors)
|
||||
{
|
||||
executeOnErrors = false;
|
||||
if (targetNames == null)
|
||||
// nothing to build
|
||||
return true;
|
||||
|
||||
foreach (string target_name in targetNames) {
|
||||
var t = project.Targets [target_name.Trim ()];
|
||||
if (t == null) {
|
||||
if (missing_target != null)
|
||||
missing_target (target_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (t.BuildState == BuildState.NotStarted)
|
||||
if (!t.Build (null, out executeOnErrors))
|
||||
return false;
|
||||
|
||||
if (t.BuildState == BuildState.Started)
|
||||
throw new InvalidProjectFileException ("Cycle in target dependencies detected");
|
||||
}
|
||||
@@ -312,6 +362,19 @@ namespace Microsoft.Build.BuildEngine {
|
||||
}
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
internal string BeforeTargets {
|
||||
get { return targetElement.GetAttribute ("BeforeTargets"); }
|
||||
}
|
||||
|
||||
internal string AfterTargets {
|
||||
get { return targetElement.GetAttribute ("AfterTargets"); }
|
||||
}
|
||||
|
||||
internal List<string> BeforeThisTargets { get; set; }
|
||||
internal List<string> AfterThisTargets { get; set; }
|
||||
#endif
|
||||
|
||||
internal List<BuildTask> BuildTasks {
|
||||
get { return buildTasks; }
|
||||
}
|
||||
@@ -324,7 +387,12 @@ namespace Microsoft.Build.BuildEngine {
|
||||
get { return buildState; }
|
||||
}
|
||||
|
||||
internal ITaskItem [] Outputs {
|
||||
public string Outputs {
|
||||
get { return targetElement.GetAttribute ("Outputs"); }
|
||||
set { targetElement.SetAttribute ("Outputs", value); }
|
||||
}
|
||||
|
||||
ITaskItem [] OutputsAsITaskItems {
|
||||
get {
|
||||
string outputs = targetElement.GetAttribute ("Outputs");
|
||||
if (outputs == String.Empty)
|
||||
|
||||
@@ -86,6 +86,12 @@ namespace Microsoft.Build.BuildEngine {
|
||||
yield return kvp.Value;
|
||||
}
|
||||
|
||||
internal IEnumerable<Target> AsIEnumerable ()
|
||||
{
|
||||
foreach (KeyValuePair <string, Target> kvp in targetsByName)
|
||||
yield return kvp.Value;
|
||||
}
|
||||
|
||||
public void RemoveTarget (Target targetToRemove)
|
||||
{
|
||||
if (targetToRemove == null)
|
||||
|
||||
@@ -177,10 +177,6 @@ namespace Microsoft.Build.BuildEngine {
|
||||
throw new InvalidProjectFileException ("This is not output property.");
|
||||
|
||||
o = propertyInfo.GetValue (task, null);
|
||||
// FIXME: maybe we should throw an exception here?
|
||||
if (o == null)
|
||||
continue;
|
||||
|
||||
if (itemName != String.Empty) {
|
||||
PublishItemGroup (propertyInfo, o, itemName);
|
||||
} else {
|
||||
@@ -198,6 +194,11 @@ namespace Microsoft.Build.BuildEngine {
|
||||
object o,
|
||||
string propertyName)
|
||||
{
|
||||
if (o == null) {
|
||||
parentProject.EvaluatedProperties.RemoveProperty (propertyName);
|
||||
return;
|
||||
}
|
||||
|
||||
BuildProperty bp;
|
||||
try {
|
||||
bp = ChangeType.ToBuildProperty (o, propertyInfo.PropertyType, propertyName);
|
||||
@@ -214,6 +215,9 @@ namespace Microsoft.Build.BuildEngine {
|
||||
object o,
|
||||
string itemName)
|
||||
{
|
||||
if (o == null)
|
||||
return;
|
||||
|
||||
BuildItemGroup newItems;
|
||||
try {
|
||||
newItems = ChangeType.ToBuildItemGroup (o, propertyInfo.PropertyType, itemName);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -783,7 +783,6 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
|
||||
logger.DumpMessages ();
|
||||
Assert.Fail ("Build failed");
|
||||
}
|
||||
logger.DumpMessages ();
|
||||
|
||||
CheckMetadata (project, "A", "Meta", new string[] { "@(B)", "" }, "K1");
|
||||
CheckEvaluatedMetadata (project, "A", "Meta", new string[] { "", "" }, "K2");
|
||||
|
||||
+4
-2
@@ -374,9 +374,11 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
|
||||
|
||||
xd = new XmlDocument ();
|
||||
xd.LoadXml (project.Xml);
|
||||
Console.WriteLine(project.Xml);
|
||||
node = xd.SelectSingleNode ("tns:Project/tns:PropertyGroup/tns:XmlProp/tns:XmlStuff", TestNamespaceManager.NamespaceManager);
|
||||
Assert.IsNotNull (node, "A1");
|
||||
if (node == null) {
|
||||
Console.WriteLine (project.Xml);
|
||||
Assert.Fail ("Expected node to be non-null");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -342,6 +342,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
|
||||
bt [0].AddOutputItem ("Property", "ItemName");
|
||||
project.Build ("T");
|
||||
|
||||
Assert.IsNotNull (project.EvaluatedItems [0], "No items found");
|
||||
Assert.AreEqual ("ItemName", project.EvaluatedItems [0].Name, "A1");
|
||||
Assert.AreEqual ("some_text", project.EvaluatedItems [0].FinalItemSpec, "A2");
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -209,5 +209,62 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
|
||||
project.LoadXml (documentString);
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
[Test]
|
||||
public void TestImportWildcard ()
|
||||
{
|
||||
string main_project_xml = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""4.0"">
|
||||
<ItemGroup>
|
||||
<FooItem Include=""From main.proj""/>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project=""tmp\*""/>
|
||||
|
||||
<Target Name=""Build"">
|
||||
<Message Text=""FooItem: @(FooItem)""/>
|
||||
</Target>
|
||||
</Project>";
|
||||
|
||||
string other_project_xml = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""4.0"">
|
||||
<ItemGroup>
|
||||
<FooItem Include=""From $(MSBuildThisFile)""/>
|
||||
</ItemGroup>
|
||||
</Project>";
|
||||
|
||||
Engine engine = new Engine (Consts.BinPath);
|
||||
MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
|
||||
new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
|
||||
engine.RegisterLogger (logger);
|
||||
|
||||
string base_dir = Path.GetFullPath (Path.Combine ("Test", "resources")) + Path.DirectorySeparatorChar;
|
||||
string tmp_dir = Path.GetFullPath (Path.Combine (base_dir, "tmp")) + Path.DirectorySeparatorChar;
|
||||
|
||||
string main_project = Path.Combine (base_dir, "main.proj");
|
||||
string first_project = Path.Combine (tmp_dir, "first.proj");
|
||||
string second_project = Path.Combine (tmp_dir, "second.proj");
|
||||
|
||||
Directory.CreateDirectory (tmp_dir);
|
||||
File.WriteAllText (main_project, main_project_xml);
|
||||
File.WriteAllText (first_project, other_project_xml);
|
||||
File.WriteAllText (second_project, other_project_xml);
|
||||
|
||||
Project project = engine.CreateNewProject ();
|
||||
project.Load (main_project);
|
||||
try {
|
||||
Assert.IsTrue (project.Build ("Build"), "Build failed");
|
||||
|
||||
logger.CheckLoggedMessageHead ("FooItem: From main.proj;From first.proj;From second.proj", "A1");
|
||||
Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
|
||||
} catch {
|
||||
logger.DumpMessages ();
|
||||
throw;
|
||||
} finally {
|
||||
File.Delete (main_project);
|
||||
File.Delete (first_project);
|
||||
File.Delete (second_project);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
|
||||
Assert.AreEqual (false, project.IsDirty, "A4");
|
||||
Assert.AreEqual (false, project.IsValidated, "A5");
|
||||
Assert.AreEqual (engine, project.ParentEngine, "A6");
|
||||
Console.WriteLine ("time: {0} p.t: {1}", time, project.TimeOfLastDirty);
|
||||
//Console.WriteLine ("time: {0} p.t: {1}", time, project.TimeOfLastDirty);
|
||||
Assert.IsTrue (time <= project.TimeOfLastDirty, "A7");
|
||||
Assert.IsTrue (String.Empty != project.Xml, "A8");
|
||||
return;
|
||||
@@ -1487,7 +1487,6 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
|
||||
logger.DumpMessages ();
|
||||
Assert.Fail ("A1: Build failed");
|
||||
}
|
||||
logger.DumpMessages ();
|
||||
BuildItemGroup include = project.GetEvaluatedItemsByName ("FinalList");
|
||||
Assert.AreEqual (3, include.Count, "A2");
|
||||
}
|
||||
@@ -1831,6 +1830,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 ()
|
||||
@@ -2013,7 +2103,6 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
|
||||
logger.DumpMessages ();
|
||||
Assert.Fail ("A1: Build failed");
|
||||
}
|
||||
logger.DumpMessages ();
|
||||
|
||||
logger.CheckLoggedMessageHead ("Full item: foo;FOO;hmm;bar", "#A2");
|
||||
logger.CheckLoggedMessageHead ("metadata1 :md1 metadata2: md2", "#A3");
|
||||
@@ -2174,7 +2263,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
|
||||
logger.CheckLoggedMessageHead (expected_output_msg, "A");
|
||||
Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected messages found");
|
||||
}
|
||||
} finally {
|
||||
} catch {
|
||||
logger.DumpMessages ();
|
||||
}
|
||||
return project;
|
||||
|
||||
@@ -420,5 +420,61 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
|
||||
Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
[Test]
|
||||
public void TestBeforeAndAfterTargets ()
|
||||
{
|
||||
Engine engine;
|
||||
Project project;
|
||||
|
||||
string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""4.0"">
|
||||
<Target Name=""DefaultBeforeTarget1"" BeforeTargets=""Default"">
|
||||
<Message Text=""Hello from DefaultBeforeTarget1""/>
|
||||
</Target>
|
||||
|
||||
<Target Name=""DefaultBeforeTarget2"" BeforeTargets=""Default;Default;NonExistant"">
|
||||
<Message Text=""Hello from DefaultBeforeTarget2""/>
|
||||
</Target>
|
||||
|
||||
|
||||
<Target Name=""DefaultAfterTarget"" AfterTargets=""Default ; Foo"">
|
||||
<Message Text=""Hello from DefaultAfterTarget""/>
|
||||
</Target>
|
||||
|
||||
<Target Name=""Default"" DependsOnTargets=""DefaultDependsOn"">
|
||||
<Message Text=""Hello from Default""/>
|
||||
</Target>
|
||||
|
||||
<Target Name=""DefaultDependsOn"">
|
||||
<Message Text=""Hello from DefaultDependsOn""/>
|
||||
</Target>
|
||||
</Project>";
|
||||
|
||||
engine = new Engine ();
|
||||
project = engine.CreateNewProject ();
|
||||
project.LoadXml (projectString);
|
||||
|
||||
MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
|
||||
new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
|
||||
engine.RegisterLogger (logger);
|
||||
|
||||
if (!project.Build ("Default")) {
|
||||
logger.DumpMessages ();
|
||||
Assert.Fail ("Build failed");
|
||||
}
|
||||
|
||||
logger.CheckLoggedMessageHead ("Hello from DefaultDependsOn", "A1");
|
||||
logger.CheckLoggedMessageHead ("Hello from DefaultBeforeTarget1", "A1");
|
||||
logger.CheckLoggedMessageHead ("Hello from DefaultBeforeTarget2", "A1");
|
||||
logger.CheckLoggedMessageHead ("Hello from Default", "A1");
|
||||
logger.CheckLoggedMessageHead ("Hello from DefaultAfterTarget", "A1");
|
||||
|
||||
Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected messages found");
|
||||
|
||||
//warnings for referencing unknown targets: NonExistant and Foo
|
||||
Assert.AreEqual (2, logger.WarningsCount, "Expected warnings not raised");
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -575,7 +575,6 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
|
||||
Assert.Fail ("Build failed");
|
||||
}
|
||||
|
||||
logger.DumpMessages ();
|
||||
logger.CheckLoggedMessageHead ("Prop2: File1", "A1");
|
||||
logger.CheckLoggedMessageHead ("Files: File1", "A1");
|
||||
logger.CheckLoggedMessageHead ("Files: File1", "A1");
|
||||
@@ -710,7 +709,6 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
|
||||
Assert.Fail ("Build failed");
|
||||
}
|
||||
|
||||
logger.DumpMessages ();
|
||||
logger.CheckLoggedMessageHead ("Item1: Item1OldVal", "A1");
|
||||
logger.CheckLoggedMessageHead ("Item1: Val", "A2");
|
||||
logger.CheckLoggedMessageHead ("Item2: Item2OldVal", "A3");
|
||||
@@ -787,7 +785,6 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
|
||||
Assert.Fail ("Build failed");
|
||||
}
|
||||
|
||||
logger.DumpMessages ();
|
||||
logger.CheckLoggedMessageHead ("output1: property: null ## array: null", "A1");
|
||||
logger.CheckLoggedMessageHead ("output2: property: ## array: null", "A2");
|
||||
logger.CheckLoggedMessageHead ("output3: property: null ## array: null", "A3");
|
||||
@@ -1494,7 +1491,6 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
|
||||
logger.DumpMessages ();
|
||||
Assert.Fail ("Build failed");
|
||||
}
|
||||
logger.DumpMessages ();
|
||||
|
||||
logger.CheckLoggedMessageHead ("file1: " + Path.Combine ("bar", "foo.dll"), "A1");
|
||||
|
||||
|
||||
@@ -79,6 +79,7 @@ Microsoft.Build.Tasks/GenerateTrustInfo.cs
|
||||
Microsoft.Build.Tasks/GetAssemblyIdentity.cs
|
||||
Microsoft.Build.Tasks/GetFrameworkPath.cs
|
||||
Microsoft.Build.Tasks/GetFrameworkSdkPath.cs
|
||||
Microsoft.Build.Tasks/GetReferenceAssemblyPaths.cs
|
||||
Microsoft.Build.Tasks.Hosting/ICscHostObject.cs
|
||||
Microsoft.Build.Tasks.Hosting/IVbcHostObject.cs
|
||||
Microsoft.Build.Tasks/LC.cs
|
||||
@@ -104,7 +105,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 +113,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
|
||||
@@ -37,8 +37,6 @@ using Mono.XBuild.Utilities;
|
||||
namespace Microsoft.Build.Tasks {
|
||||
public class AL : ToolTaskExtension {
|
||||
|
||||
Process alProcess;
|
||||
|
||||
public AL ()
|
||||
{
|
||||
}
|
||||
@@ -237,7 +235,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"; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ namespace Microsoft.Build.Tasks {
|
||||
Dictionary<string, TargetFrameworkAssemblies> target_framework_cache;
|
||||
Dictionary<string, Dictionary<Version, string>> gac;
|
||||
TaskLoggingHelper log;
|
||||
StringWriter sw;
|
||||
List<string> search_log;
|
||||
|
||||
static LibraryPcFileCache cache;
|
||||
@@ -121,7 +120,10 @@ namespace Microsoft.Build.Tasks {
|
||||
if (!Directory.Exists (framework_dir))
|
||||
return null;
|
||||
|
||||
AssemblyName key_aname = new AssemblyName (reference.ItemSpec);
|
||||
AssemblyName key_aname;
|
||||
if (!TryGetAssemblyNameFromFullName (reference.ItemSpec, out key_aname))
|
||||
return null;
|
||||
|
||||
TargetFrameworkAssemblies gac_asm;
|
||||
if (!target_framework_cache.TryGetValue (framework_dir, out gac_asm)) {
|
||||
// fill gac_asm
|
||||
@@ -160,7 +162,9 @@ namespace Microsoft.Build.Tasks {
|
||||
|
||||
// Try as a filename
|
||||
string path = Path.GetFullPath (Path.Combine (directory, filename));
|
||||
AssemblyName aname = specific_version ? new AssemblyName (reference.ItemSpec) : null;
|
||||
AssemblyName aname = null;
|
||||
if (specific_version && !TryGetAssemblyNameFromFullName (reference.ItemSpec, out aname))
|
||||
return null;
|
||||
|
||||
ResolvedReference resolved_ref = ResolveReferenceForPath (path, reference, aname, null, SearchPath.Directory, specific_version);
|
||||
if (resolved_ref != null)
|
||||
@@ -181,8 +185,8 @@ namespace Microsoft.Build.Tasks {
|
||||
ResolvedReference ResolveReferenceForPath (string filename, ITaskItem reference, AssemblyName aname,
|
||||
string error_message, SearchPath spath, bool specific_version)
|
||||
{
|
||||
AssemblyName found_aname = GetAssemblyNameFromFile (filename);
|
||||
if (found_aname == null) {
|
||||
AssemblyName found_aname;
|
||||
if (!TryGetAssemblyNameFromFile (filename, out found_aname)) {
|
||||
if (error_message != null)
|
||||
log.LogMessage (MessageImportance.Low, error_message);
|
||||
return null;
|
||||
@@ -204,8 +208,8 @@ namespace Microsoft.Build.Tasks {
|
||||
{
|
||||
TargetFrameworkAssemblies gac_asm = new TargetFrameworkAssemblies (directory);
|
||||
foreach (string file in Directory.GetFiles (directory, "*.dll")) {
|
||||
AssemblyName aname = GetAssemblyNameFromFile (file);
|
||||
if (aname != null)
|
||||
AssemblyName aname;
|
||||
if (TryGetAssemblyNameFromFile (file, out aname))
|
||||
gac_asm.NameToAssemblyNameCache [aname.Name] =
|
||||
new KeyValuePair<AssemblyName, string> (aname, file);
|
||||
}
|
||||
@@ -215,7 +219,10 @@ namespace Microsoft.Build.Tasks {
|
||||
|
||||
public ResolvedReference ResolveGacReference (ITaskItem reference, bool specific_version)
|
||||
{
|
||||
AssemblyName name = new AssemblyName (reference.ItemSpec);
|
||||
AssemblyName name;
|
||||
if (!TryGetAssemblyNameFromFullName (reference.ItemSpec, out name))
|
||||
return null;
|
||||
|
||||
if (!gac.ContainsKey (name.Name)) {
|
||||
LogSearchMessage ("Considered {0}, but could not find in the GAC.",
|
||||
reference.ItemSpec);
|
||||
@@ -264,7 +271,11 @@ namespace Microsoft.Build.Tasks {
|
||||
return null;
|
||||
}
|
||||
|
||||
ResolvedReference rr = GetResolvedReference (reference, pkg.File, new AssemblyName (pkg.FullName),
|
||||
AssemblyName aname;
|
||||
if (!TryGetAssemblyNameFromFullName (pkg.FullName, out aname))
|
||||
return null;
|
||||
|
||||
ResolvedReference rr = GetResolvedReference (reference, pkg.File, aname,
|
||||
false, SearchPath.PkgConfig);
|
||||
rr.FoundInSearchPathAsString = String.Format ("{{PkgConfig}} provided by package named {0}",
|
||||
pkg.ParentPackage.Name);
|
||||
@@ -291,14 +302,18 @@ namespace Microsoft.Build.Tasks {
|
||||
return null;
|
||||
}
|
||||
|
||||
return ResolveReferenceForPath (hintpath, reference, new AssemblyName (reference.ItemSpec),
|
||||
AssemblyName aname;
|
||||
if (!TryGetAssemblyNameFromFullName (reference.ItemSpec, out aname))
|
||||
return null;
|
||||
|
||||
return ResolveReferenceForPath (hintpath, reference, aname,
|
||||
String.Format ("File at HintPath {0}, is either an invalid assembly or the file does not exist.", hintpath),
|
||||
SearchPath.HintPath, specific_version);
|
||||
}
|
||||
|
||||
public AssemblyName GetAssemblyNameFromFile (string filename)
|
||||
public bool TryGetAssemblyNameFromFile (string filename, out AssemblyName aname)
|
||||
{
|
||||
AssemblyName aname = null;
|
||||
aname = null;
|
||||
filename = Path.GetFullPath (filename);
|
||||
try {
|
||||
aname = AssemblyName.GetAssemblyName (filename);
|
||||
@@ -310,7 +325,19 @@ namespace Microsoft.Build.Tasks {
|
||||
filename);
|
||||
}
|
||||
|
||||
return aname;
|
||||
return aname != null;
|
||||
}
|
||||
|
||||
bool TryGetAssemblyNameFromFullName (string full_name, out AssemblyName aname)
|
||||
{
|
||||
aname = null;
|
||||
try {
|
||||
aname = new AssemblyName (full_name);
|
||||
} catch (FileLoadException) {
|
||||
LogSearchMessage ("Considered '{0}' as an assembly name, but it is invalid.", full_name);
|
||||
}
|
||||
|
||||
return aname != null;
|
||||
}
|
||||
|
||||
internal static bool AssemblyNamesCompatible (AssemblyName a, AssemblyName b, bool specificVersion)
|
||||
@@ -341,11 +368,8 @@ namespace Microsoft.Build.Tasks {
|
||||
bool a_is_empty = (a_bytes == null || a_bytes.Length == 0);
|
||||
bool b_is_empty = (b_bytes == null || b_bytes.Length == 0);
|
||||
|
||||
if (a_is_empty && b_is_empty)
|
||||
return true;
|
||||
|
||||
if (a_is_empty || b_is_empty)
|
||||
return false;
|
||||
return true;
|
||||
|
||||
for (int i = 0; i < a_bytes.Length; i++)
|
||||
if (a_bytes [i] != b_bytes [i])
|
||||
|
||||
@@ -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,7 +43,8 @@ namespace Microsoft.Build.Tasks {
|
||||
public override bool Execute ()
|
||||
{
|
||||
if (Log != null)
|
||||
Log.LogError (null, code, helpKeyword, BuildEngine.ProjectFileOfTaskNode,
|
||||
Log.LogError (null, code, helpKeyword,
|
||||
String.IsNullOrEmpty (File) ? BuildEngine.ProjectFileOfTaskNode : File,
|
||||
BuildEngine.LineNumberOfTaskNode, BuildEngine.ColumnNumberOfTaskNode,
|
||||
BuildEngine.LineNumberOfTaskNode, BuildEngine.ColumnNumberOfTaskNode,
|
||||
text ?? String.Empty, null);
|
||||
@@ -64,6 +65,8 @@ namespace Microsoft.Build.Tasks {
|
||||
get { return text; }
|
||||
set { text = value; }
|
||||
}
|
||||
|
||||
public string File { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ using System.Collections.Specialized;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using Microsoft.Build.Framework;
|
||||
using Microsoft.Build.Utilities;
|
||||
@@ -49,6 +50,10 @@ namespace Microsoft.Build.Tasks {
|
||||
string stdOutEncoding;
|
||||
string workingDirectory;
|
||||
string scriptFile;
|
||||
|
||||
#if NET_4_0
|
||||
Func<string, bool> errorMatcher, warningMatcher;
|
||||
#endif
|
||||
|
||||
public Exec ()
|
||||
{
|
||||
@@ -77,6 +82,10 @@ namespace Microsoft.Build.Tasks {
|
||||
string commandLineCommands)
|
||||
{
|
||||
try {
|
||||
#if NET_4_0
|
||||
errorMatcher = GetTryMatchRegexFunc (CustomErrorRegularExpression, true);
|
||||
warningMatcher = GetTryMatchRegexFunc (CustomWarningRegularExpression, false);
|
||||
#endif
|
||||
return base.ExecuteTool (pathToTool, responseFileCommands, commandLineCommands);
|
||||
} finally {
|
||||
if (scriptFile != null)
|
||||
@@ -117,9 +126,48 @@ namespace Microsoft.Build.Tasks {
|
||||
|
||||
protected override void LogEventsFromTextOutput (string singleLine, MessageImportance importance)
|
||||
{
|
||||
Log.LogMessage (importance, singleLine);
|
||||
#if NET_4_0
|
||||
if (IgnoreStandardErrorWarningFormat ||
|
||||
(!errorMatcher (singleLine) && !warningMatcher (singleLine)))
|
||||
#endif
|
||||
Log.LogMessage (importance, singleLine);
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
// @is_error_type - log as errors, else warnings
|
||||
Func<string, bool> GetTryMatchRegexFunc (string regex_str, bool is_error_type)
|
||||
{
|
||||
bool is_bad = false;
|
||||
Regex regex = null;
|
||||
return (singleLine) => {
|
||||
if (String.IsNullOrEmpty (regex_str) || is_bad)
|
||||
return false;
|
||||
|
||||
try {
|
||||
if (regex == null)
|
||||
regex = new Regex (regex_str, RegexOptions.Compiled);
|
||||
} catch (ArgumentException ae) {
|
||||
Log.LogError ("The regular expression specified for '{0}' is invalid : {1}",
|
||||
is_error_type ? "errors" : "warnings", ae.Message);
|
||||
Log.LogMessage (MessageImportance.Low, "The regular expression specified for '{0}' is invalid : {1}",
|
||||
is_error_type ? "errors" : "warnings", ae.ToString ());
|
||||
|
||||
is_bad = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!regex.Match (singleLine).Success)
|
||||
return false;
|
||||
|
||||
if (is_error_type)
|
||||
Log.LogError (singleLine);
|
||||
else
|
||||
Log.LogWarning (singleLine);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
[MonoTODO]
|
||||
protected override bool ValidateParameters ()
|
||||
{
|
||||
@@ -162,6 +210,14 @@ namespace Microsoft.Build.Tasks {
|
||||
protected override MessageImportance StandardOutputLoggingImportance {
|
||||
get { return base.StandardOutputLoggingImportance; }
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
public bool IgnoreStandardErrorWarningFormat { get; set; }
|
||||
|
||||
public string CustomErrorRegularExpression { get; set; }
|
||||
|
||||
public string CustomWarningRegularExpression { get; set; }
|
||||
#endif
|
||||
|
||||
[MonoTODO]
|
||||
[Output]
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -0,0 +1,273 @@
|
||||
//
|
||||
// GetReferenceAssemblyPaths.cs: Gets the target framework directories corresponding
|
||||
// to target framework moniker
|
||||
//
|
||||
// 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.
|
||||
|
||||
using System;
|
||||
using Microsoft.Build.Framework;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Xml;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Mono.XBuild.Utilities;
|
||||
|
||||
#if NET_4_0
|
||||
|
||||
namespace Microsoft.Build.Tasks
|
||||
{
|
||||
public class GetReferenceAssemblyPaths : TaskExtension
|
||||
{
|
||||
static string framework_base_path;
|
||||
static string PathSeparatorAsString = Path.PathSeparator.ToString ();
|
||||
const string MacOSXExternalXBuildDir = "/Library/Frameworks/Mono.framework/External/xbuild-frameworks";
|
||||
|
||||
public GetReferenceAssemblyPaths ()
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Execute ()
|
||||
{
|
||||
FrameworkMoniker moniker = null;
|
||||
if (!TryParseTargetFrameworkMoniker (TargetFrameworkMoniker, out moniker))
|
||||
return false;
|
||||
|
||||
var framework = GetFrameworkDirectoriesForMoniker (moniker);
|
||||
if (framework == null) {
|
||||
Log.LogWarning ("Unable to find framework corresponding to the target framework moniker '{0}'. " +
|
||||
"Framework assembly references will be resolved from the GAC, which might not be " +
|
||||
"the intended behavior.", TargetFrameworkMoniker);
|
||||
return true;
|
||||
}
|
||||
|
||||
ReferenceAssemblyPaths = FullFrameworkReferenceAssemblyPaths = framework.Directories;
|
||||
TargetFrameworkMonikerDisplayName = framework.DisplayName;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Framework GetFrameworkDirectoriesForMoniker (FrameworkMoniker moniker)
|
||||
{
|
||||
string dirs = String.Join (PathSeparatorAsString, new string [] {
|
||||
Environment.GetEnvironmentVariable ("XBUILD_FRAMEWORK_FOLDERS_PATH") ?? String.Empty,
|
||||
MSBuildUtils.RunningOnMac ? MacOSXExternalXBuildDir : String.Empty,
|
||||
RootPath,
|
||||
DefaultFrameworksBasePath });
|
||||
|
||||
string [] paths = dirs.Split (new char [] {Path.PathSeparator}, StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach (string path in paths) {
|
||||
var framework = GetFrameworkDirectoriesForMoniker (moniker, path);
|
||||
if (framework != null)
|
||||
return framework;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
//@base_path must be absolute
|
||||
Framework GetFrameworkDirectoriesForMoniker (FrameworkMoniker moniker, string base_path)
|
||||
{
|
||||
if (String.IsNullOrEmpty (base_path)) {
|
||||
Log.LogMessage (MessageImportance.Low, "Invalid *empty* base path, ignoring. " + Environment.StackTrace);
|
||||
return null;
|
||||
}
|
||||
|
||||
Log.LogMessage (MessageImportance.Low, "Looking for framework '{0}' in root path '{1}'",
|
||||
moniker, base_path);
|
||||
string framework_path = Path.Combine (base_path, Path.Combine (moniker.Identifier, moniker.Version));
|
||||
if (!String.IsNullOrEmpty (moniker.Profile))
|
||||
framework_path = Path.Combine (framework_path, moniker.Profile);
|
||||
|
||||
string redistlist_dir = Path.Combine (framework_path, "RedistList");
|
||||
string framework_list = Path.Combine (redistlist_dir, "FrameworkList.xml");
|
||||
if (!File.Exists (framework_list)) {
|
||||
Log.LogMessage (MessageImportance.Low,
|
||||
"Unable to find framework definition file '{0}' for Target Framework Moniker '{1}'",
|
||||
framework_list, moniker);
|
||||
return null;
|
||||
}
|
||||
|
||||
Log.LogMessage (MessageImportance.Low, "Found framework definition list '{0}' for framework '{1}'",
|
||||
framework_list, moniker);
|
||||
XmlReader xr = XmlReader.Create (framework_list);
|
||||
try {
|
||||
xr.MoveToContent ();
|
||||
if (xr.LocalName != "FileList") {
|
||||
Log.LogMessage (MessageImportance.Low, "Invalid frameworklist '{0}', expected a 'FileList' root element.",
|
||||
framework_list);
|
||||
return null;
|
||||
}
|
||||
|
||||
var framework = new Framework ();
|
||||
framework.DisplayName = xr.GetAttribute ("Name");
|
||||
string framework_dir = xr.GetAttribute ("TargetFrameworkDirectory");
|
||||
if (String.IsNullOrEmpty (framework_dir))
|
||||
framework_dir = Path.Combine (redistlist_dir, "..");
|
||||
else
|
||||
framework_dir = Path.Combine (redistlist_dir, framework_dir);
|
||||
|
||||
var directories = new List<string> ();
|
||||
directories.Add (MSBuildUtils.FromMSBuildPath (framework_dir));
|
||||
|
||||
string include = xr.GetAttribute ("IncludeFramework");
|
||||
if (!String.IsNullOrEmpty (include)) {
|
||||
var included_framework = GetFrameworkDirectoriesForMoniker (new FrameworkMoniker (moniker.Identifier, include, null));
|
||||
|
||||
if (included_framework != null && included_framework.Directories != null)
|
||||
directories.AddRange (included_framework.Directories);
|
||||
}
|
||||
|
||||
framework.Directories = directories.ToArray ();
|
||||
|
||||
return framework;
|
||||
} catch (XmlException xe) {
|
||||
Log.LogWarning ("Error reading framework definition file '{0}': {1}", framework_list, xe.Message);
|
||||
Log.LogMessage (MessageImportance.Low, "Error reading framework definition file '{0}': {1}", framework_list,
|
||||
xe.ToString ());
|
||||
return null;
|
||||
} finally {
|
||||
if (xr != null)
|
||||
((IDisposable)xr).Dispose ();
|
||||
}
|
||||
}
|
||||
|
||||
bool TryParseTargetFrameworkMoniker (string moniker_literal, out FrameworkMoniker moniker)
|
||||
{
|
||||
moniker = null;
|
||||
if (String.IsNullOrEmpty (moniker_literal))
|
||||
throw new ArgumentException ("Empty moniker string");
|
||||
|
||||
string [] parts = moniker_literal.Split (new char [] {','}, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
if (parts.Length < 2 || parts.Length > 3) {
|
||||
LogInvalidMonikerError (null, moniker_literal);
|
||||
return false;
|
||||
}
|
||||
|
||||
string identifier = parts [0];
|
||||
string version = null;
|
||||
string profile = null;
|
||||
|
||||
if (!parts [1].StartsWith ("Version=")) {
|
||||
LogInvalidMonikerError ("Invalid framework name", moniker_literal);
|
||||
return false;
|
||||
}
|
||||
|
||||
version = parts [1].Substring (8);
|
||||
if (String.IsNullOrEmpty (version)) {
|
||||
LogInvalidMonikerError ("Invalid framework version", moniker_literal);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (parts.Length > 2) {
|
||||
if (!parts [2].StartsWith ("Profile=")) {
|
||||
LogInvalidMonikerError ("Invalid framework version", moniker_literal);
|
||||
return false;
|
||||
}
|
||||
|
||||
profile = parts [2].Substring (8);
|
||||
if (String.IsNullOrEmpty (profile)) {
|
||||
LogInvalidMonikerError ("Invalid framework profile", moniker_literal);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
moniker = new FrameworkMoniker (identifier, version, profile);
|
||||
return true;
|
||||
}
|
||||
|
||||
void LogInvalidMonikerError (string msg, string moniker_literal)
|
||||
{
|
||||
if (msg != null)
|
||||
Log.LogError ("{0} in the Target Framework Moniker '{1}'. Expected format: 'Identifier,Version=<version>[,Profile=<profile>]'. " +
|
||||
"It should have either 2 or 3 comma separated components.", msg, moniker_literal);
|
||||
else
|
||||
Log.LogError ("Invalid Target Framework Moniker '{0}'. Expected format: 'Identifier,Version=<version>[,Profile=<profile>]'. " +
|
||||
"It should have either 2 or 3 comma separated components.", moniker_literal);
|
||||
}
|
||||
|
||||
[Required]
|
||||
public string TargetFrameworkMoniker { get; set; }
|
||||
|
||||
public string RootPath { get; set; }
|
||||
|
||||
public bool BypassFrameworkInstallChecks { get; set; }
|
||||
|
||||
[Output]
|
||||
public string TargetFrameworkMonikerDisplayName { get; set; }
|
||||
|
||||
[Output]
|
||||
public string[] ReferenceAssemblyPaths { get; set; }
|
||||
|
||||
[Output]
|
||||
public string[] FullFrameworkReferenceAssemblyPaths { get; set; }
|
||||
|
||||
static string DefaultFrameworksBasePath {
|
||||
get {
|
||||
if (framework_base_path == null) {
|
||||
// NOTE: code from mcs/tools/gacutil/driver.cs
|
||||
PropertyInfo gac = typeof (System.Environment).GetProperty (
|
||||
"GacPath", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
|
||||
if (gac != null) {
|
||||
MethodInfo get_gac = gac.GetGetMethod (true);
|
||||
string gac_path = (string) get_gac.Invoke (null, null);
|
||||
framework_base_path = Path.GetFullPath (Path.Combine (
|
||||
gac_path, Path.Combine ("..", "xbuild-frameworks")));
|
||||
}
|
||||
}
|
||||
return framework_base_path;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class FrameworkMoniker {
|
||||
public readonly string Identifier;
|
||||
public readonly string Version;
|
||||
public readonly string Profile;
|
||||
|
||||
public FrameworkMoniker (string identifier, string version, string profile)
|
||||
{
|
||||
this.Identifier = identifier;
|
||||
this.Version = version;
|
||||
this.Profile = profile;
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
if (String.IsNullOrEmpty (Profile))
|
||||
return String.Format ("{0},Version={1}", Identifier, Version);
|
||||
return String.Format ("{0},Version={1},Profile={2}", Identifier, Version, Profile);
|
||||
}
|
||||
}
|
||||
|
||||
class Framework {
|
||||
public string[] Directories;
|
||||
public string DisplayName;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -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");
|
||||
|
||||
@@ -99,6 +99,8 @@ namespace Microsoft.Build.Tasks {
|
||||
// nothing to resolve
|
||||
return true;
|
||||
|
||||
LogTaskParameters ();
|
||||
|
||||
assembly_resolver.Log = Log;
|
||||
tempResolvedFiles = new List<ITaskItem> ();
|
||||
tempCopyLocalFiles = new Dictionary<string, ITaskItem> ();
|
||||
@@ -212,8 +214,8 @@ namespace Microsoft.Build.Tasks {
|
||||
resolved = assembly_resolver.ResolveGacReference (item, specific_version);
|
||||
} else if (String.Compare (spath, "{RawFileName}") == 0) {
|
||||
//FIXME: identify assembly names, as extract the name, and try with that?
|
||||
AssemblyName aname = assembly_resolver.GetAssemblyNameFromFile (item.ItemSpec);
|
||||
if (aname != null)
|
||||
AssemblyName aname;
|
||||
if (assembly_resolver.TryGetAssemblyNameFromFile (item.ItemSpec, out aname))
|
||||
resolved = assembly_resolver.GetResolvedReference (item, item.ItemSpec, aname, true,
|
||||
SearchPath.RawFileName);
|
||||
} else if (String.Compare (spath, "{CandidateAssemblyFiles}") == 0) {
|
||||
@@ -280,8 +282,8 @@ namespace Microsoft.Build.Tasks {
|
||||
LogWithPrecedingNewLine (MessageImportance.Low, "Primary Reference from AssemblyFiles {0}", item.ItemSpec);
|
||||
string copy_local;
|
||||
|
||||
AssemblyName aname = assembly_resolver.GetAssemblyNameFromFile (item.ItemSpec);
|
||||
if (aname == null) {
|
||||
AssemblyName aname;
|
||||
if (!assembly_resolver.TryGetAssemblyNameFromFile (item.ItemSpec, out aname)) {
|
||||
Log.LogWarning ("Reference '{0}' not resolved", item.ItemSpec);
|
||||
assembly_resolver.LogSearchLoggerMessages (MessageImportance.Normal);
|
||||
continue;
|
||||
@@ -523,6 +525,19 @@ namespace Microsoft.Build.Tasks {
|
||||
rr.FoundInSearchPath == SearchPath.TargetFrameworkDirectory;
|
||||
}
|
||||
|
||||
void LogTaskParameters ()
|
||||
{
|
||||
Log.LogMessage (MessageImportance.Low, "TargetFrameworkDirectories:");
|
||||
if (TargetFrameworkDirectories != null)
|
||||
foreach (string dir in TargetFrameworkDirectories)
|
||||
Log.LogMessage (MessageImportance.Low, "\t{0}", dir);
|
||||
|
||||
Log.LogMessage (MessageImportance.Low, "SearchPaths:");
|
||||
if (SearchPaths != null)
|
||||
foreach (string path in SearchPaths)
|
||||
Log.LogMessage (MessageImportance.Low, "\t{0}", path);
|
||||
}
|
||||
|
||||
public bool AutoUnify {
|
||||
get { return autoUnify; }
|
||||
set { autoUnify = value; }
|
||||
@@ -644,7 +659,15 @@ namespace Microsoft.Build.Tasks {
|
||||
public ITaskItem[] SuggestedRedirects {
|
||||
get { return suggestedRedirects; }
|
||||
}
|
||||
|
||||
|
||||
#if NET_4_0
|
||||
public string TargetFrameworkMoniker { get; set; }
|
||||
|
||||
public string TargetFrameworkMonikerDisplayName { get; set; }
|
||||
#endif
|
||||
|
||||
public string TargetFrameworkVersion { get; set; }
|
||||
|
||||
public string[] TargetFrameworkDirectories {
|
||||
get { return targetFrameworkDirectories; }
|
||||
set { targetFrameworkDirectories = value; }
|
||||
@@ -655,6 +678,7 @@ namespace Microsoft.Build.Tasks {
|
||||
set { targetProcessorArchitecture = value; }
|
||||
}
|
||||
|
||||
|
||||
static Dictionary<string, string> cultureNamesTable;
|
||||
static Dictionary<string, string> CultureNamesTable {
|
||||
get {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -182,7 +183,7 @@ namespace Microsoft.Build.Tasks {
|
||||
string col = match.Result ("${column}");
|
||||
int columnNumber = 0;
|
||||
if (!string.IsNullOrEmpty (col))
|
||||
columnNumber = col == "255+" ? -1 : Int32.Parse (col);
|
||||
columnNumber = col.IndexOf ("+") >= 0 ? -1 : Int32.Parse (col);
|
||||
|
||||
string category = match.Result ("${level}");
|
||||
string code = match.Result ("${number}");
|
||||
@@ -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]
|
||||
|
||||
@@ -47,7 +47,8 @@ namespace Microsoft.Build.Tasks {
|
||||
if (String.IsNullOrEmpty (text))
|
||||
return true;
|
||||
|
||||
Log.LogWarning (null, code, helpKeyword, BuildEngine.ProjectFileOfTaskNode,
|
||||
Log.LogWarning (null, code, helpKeyword,
|
||||
String.IsNullOrEmpty (File) ? BuildEngine.ProjectFileOfTaskNode : File,
|
||||
BuildEngine.LineNumberOfTaskNode, BuildEngine.ColumnNumberOfTaskNode,
|
||||
BuildEngine.LineNumberOfTaskNode, BuildEngine.ColumnNumberOfTaskNode,
|
||||
text, null);
|
||||
@@ -68,6 +69,8 @@ namespace Microsoft.Build.Tasks {
|
||||
get { return text; }
|
||||
set { text = value; }
|
||||
}
|
||||
|
||||
public string File { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ namespace MonoTests.Microsoft.Build.Tasks
|
||||
|
||||
string [] files;
|
||||
Project project;
|
||||
Engine engine;
|
||||
|
||||
[SetUp]
|
||||
public void SetUp ()
|
||||
@@ -63,7 +64,7 @@ namespace MonoTests.Microsoft.Build.Tasks
|
||||
"sample.txt", @"bar\sample.txt",
|
||||
"sample.it.png", @"dir\sample.en.png", "sample.inv.txt"};
|
||||
|
||||
Engine engine = new Engine (Consts.BinPath);
|
||||
engine = new Engine (Consts.BinPath);
|
||||
project = engine.CreateNewProject ();
|
||||
}
|
||||
|
||||
@@ -141,7 +142,14 @@ namespace MonoTests.Microsoft.Build.Tasks
|
||||
{
|
||||
string projectText = CreateProjectString (files_list);
|
||||
project.LoadXml (projectText);
|
||||
Assert.IsTrue (project.Build ("1"), "A1 : Error in building");
|
||||
|
||||
TestMessageLogger testLogger = new TestMessageLogger ();
|
||||
engine.RegisterLogger (testLogger);
|
||||
|
||||
if (!project.Build ("1")) {
|
||||
testLogger.DumpMessages ();
|
||||
Assert.Fail ("A1 : Error in building");
|
||||
}
|
||||
}
|
||||
|
||||
void CheckItems (string [] values, string [] cultures, string itemlist_name, string prefix)
|
||||
|
||||
-1
@@ -118,7 +118,6 @@ namespace MonoTests.Microsoft.Build.Tasks
|
||||
|
||||
try {
|
||||
Assert.AreEqual (build_result, project.Build (), "Build " + (build_result ? "failed" : "should've failed"));
|
||||
testLogger.DumpMessages ();
|
||||
if (!build_result || messages == null)
|
||||
// build failed as expected, don't check outputs
|
||||
return;
|
||||
|
||||
@@ -115,6 +115,69 @@ 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 [] {
|
||||
PathCombine ("Test", "Link", "xyz.cs"),
|
||||
PathCombine ("Test", "Link", "bar.resx"),
|
||||
PathCombine ("..", "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");
|
||||
}
|
||||
}
|
||||
|
||||
string PathCombine (string path1, params string[] parts)
|
||||
{
|
||||
if (parts == null || parts.Length == 0)
|
||||
return path1;
|
||||
|
||||
string final_path = path1;
|
||||
foreach (string part in parts)
|
||||
final_path = Path.Combine (final_path, part);
|
||||
|
||||
return final_path;
|
||||
}
|
||||
|
||||
void CheckTargetPath(string[] files, string[] assignedFiles, string rootFolder, string id)
|
||||
{
|
||||
Engine engine = new Engine(Consts.BinPath);
|
||||
|
||||
@@ -210,7 +210,6 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
testLogger.DumpMessages ();
|
||||
Assert.Fail ("Build failed");
|
||||
}
|
||||
testLogger.DumpMessages ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -127,5 +127,45 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
Assert.AreEqual ("@(IG)", project.EvaluatedProperties["C"].FinalValue, "A6");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestEmptyPropertyValue ()
|
||||
{
|
||||
Engine engine;
|
||||
Project project;
|
||||
|
||||
string documentString = @"
|
||||
<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
|
||||
<PropertyGroup>
|
||||
<A>1</A>
|
||||
</PropertyGroup>
|
||||
<Target Name='1'>
|
||||
<Message Text='Before: $(A)'/>
|
||||
<CreateProperty Value=''>
|
||||
<Output
|
||||
TaskParameter='Value'
|
||||
PropertyName='A'
|
||||
/>
|
||||
</CreateProperty>
|
||||
<Message Text='After: $(A)'/>
|
||||
</Target>
|
||||
</Project>
|
||||
";
|
||||
|
||||
engine = new Engine (Consts.BinPath);
|
||||
|
||||
TestMessageLogger testLogger = new TestMessageLogger ();
|
||||
engine.RegisterLogger (testLogger);
|
||||
|
||||
project = engine.CreateNewProject ();
|
||||
project.LoadXml (documentString);
|
||||
if (!project.Build ("1")) {
|
||||
testLogger.DumpMessages ();
|
||||
Assert.Fail ("Build failed");
|
||||
}
|
||||
|
||||
testLogger.CheckLoggedMessageHead ("Before: 1", "A1");
|
||||
testLogger.CheckLoggedMessageHead ("After: ", "A2");
|
||||
Assert.AreEqual (0, testLogger.NormalMessageCount, "Unexpected messages found");
|
||||
}
|
||||
}
|
||||
}
|
||||
Loaded 100 of 931 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user