mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 17:10:20 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9435de91f2 | ||
|
|
1281853553 | ||
|
|
6922ed8629 | ||
|
|
cd3c79413a | ||
|
|
bc36fbe193 | ||
|
|
53d8062782 | ||
|
|
44983be8f2 | ||
|
|
015444e23d | ||
|
|
f4433694ac | ||
|
|
a02076baf6 | ||
|
|
0a3a379ee0 | ||
|
|
fbbe941b69 | ||
|
|
61963ca6b1 | ||
|
|
50cc972397 | ||
|
|
340361ff91 | ||
|
|
de6a0113fb | ||
|
|
636f9ec0b9 | ||
|
|
e5e8c141c5 | ||
|
|
764f9cbd32 | ||
|
|
a96b9dd614 | ||
|
|
b4c110c021 | ||
|
|
1f505f2ebb | ||
|
|
3e62b6e207 | ||
|
|
83e5c48472 | ||
|
|
abc05b767c | ||
|
|
7019e2b39f | ||
|
|
137efe9736 | ||
|
|
4752df3669 | ||
|
|
a2d3a480e9 | ||
|
|
e79c9e9135 | ||
|
|
bd511fa11e | ||
|
|
f8539f3cf6 | ||
|
|
614da57287 | ||
|
|
c8778b1133 | ||
|
|
f3692b8819 | ||
|
|
ae25c90d61 | ||
|
|
ff47ddc6db | ||
|
|
88ac3e5d4d | ||
|
|
9746e8d9f8 | ||
|
|
10bcc0d354 | ||
|
|
cf3562d2c8 | ||
|
|
2388926d50 | ||
|
|
d6be15f97b | ||
|
|
ad8e7c929f | ||
|
|
1638105782 | ||
|
|
ad939942b5 | ||
|
|
e2110645f1 | ||
|
|
55f3721a38 | ||
|
|
82d9fb288c | ||
|
|
9196c64c2a | ||
|
|
3dfc36e4ac | ||
|
|
044461a63b | ||
|
|
fd05675b35 | ||
|
|
2e9eca05b9 | ||
|
|
eefdcf1d3a | ||
|
|
8546da29ca | ||
|
|
793bbb9a87 | ||
|
|
5ff0b3b636 | ||
|
|
51eb841a56 | ||
|
|
c3026122e9 | ||
|
|
6bf88caf77 | ||
|
|
8b336154f7 | ||
|
|
9ecf360a2b | ||
|
|
9c72742bf8 | ||
|
|
5faf9e26c8 | ||
|
|
6bc4446f02 | ||
|
|
32942d4014 | ||
|
|
66c0b04951 | ||
|
|
7cbff8d169 | ||
|
|
a58017ca8e | ||
|
|
6efa57b2c2 | ||
|
|
6373d04e93 | ||
|
|
b8cd87e608 | ||
|
|
9fa7633b1f | ||
|
|
8ea6fd8ac5 | ||
|
|
29bc8d9b9c | ||
|
|
d1df969755 | ||
|
|
33e0667472 | ||
|
|
2ee0c254a4 | ||
|
|
5ddf92f33c | ||
|
|
4960cd6133 | ||
|
|
dd1a9c331a | ||
|
|
352bb2461b | ||
|
|
4ef6555a3a | ||
|
|
1e25dd1757 | ||
|
|
995a774521 | ||
|
|
4aeb0b7347 | ||
|
|
0e2108e5e0 | ||
|
|
3f246aa0b2 | ||
|
|
0222d30eab | ||
|
|
35c0bb794e | ||
|
|
d12e49a9b3 | ||
|
|
97426e608b | ||
|
|
daa4a4f0f5 | ||
|
|
b3cc72b9a7 | ||
|
|
32029f1171 | ||
|
|
44882b1925 | ||
|
|
b7ad6a07a8 | ||
|
|
2bb4353929 | ||
|
|
88df658060 | ||
|
|
6ca75c627b | ||
|
|
393f7c7f3e | ||
|
|
07268b7ab8 | ||
|
|
241a34d604 | ||
|
|
da1bdf6b34 | ||
|
|
f0737b398c | ||
|
|
f373840a8a | ||
|
|
2d1dba2a8f | ||
|
|
a8cee6b88e | ||
|
|
76debbe013 | ||
|
|
92bb5751a7 | ||
|
|
39a7dcb400 | ||
|
|
276ca3613f | ||
|
|
7e9785dc4e | ||
|
|
968a511c89 | ||
|
|
7cce646657 | ||
|
|
b033bff618 | ||
|
|
9c94be9d30 | ||
|
|
0e4b34fdd7 | ||
|
|
f784b407c4 | ||
|
|
a246a51c0f | ||
|
|
21a92702c3 | ||
|
|
dffda4000e | ||
|
|
736891c361 | ||
|
|
62e371b81b | ||
|
|
4f64a73a44 | ||
|
|
a147386bc4 | ||
|
|
d87a79de52 | ||
|
|
14a9dbdd34 | ||
|
|
fc7ffed3ac | ||
|
|
7cf63b69e6 | ||
|
|
3bb319b61d | ||
|
|
6148e4b997 | ||
|
|
39c0feba1c | ||
|
|
89881c9b4d | ||
|
|
47c388364d | ||
|
|
8ad829ac4e | ||
|
|
93e489abf2 | ||
|
|
742ff74e50 | ||
|
|
abff177b4b | ||
|
|
5524ab9825 | ||
|
|
d51f05c88b | ||
|
|
35f3c96490 | ||
|
|
c1d9d1a6b6 | ||
|
|
8bb319b1e6 | ||
|
|
37ac996882 | ||
|
|
0afd473342 | ||
|
|
4b750612a8 | ||
|
|
5d17d13bee | ||
|
|
475c172dae | ||
|
|
323ff14b65 | ||
|
|
4a6df0b082 | ||
|
|
8141307e4b | ||
|
|
27b145e24f | ||
|
|
bdaf7bb33c | ||
|
|
378032bf64 | ||
|
|
a19eb0760b | ||
|
|
5cfc62f415 | ||
|
|
1ed1c4bed1 | ||
|
|
616f648f0d | ||
|
|
4fccd4d599 | ||
|
|
bd4f80e803 | ||
|
|
9e9b3f913d | ||
|
|
a2a168e5f3 | ||
|
|
5f982b1908 | ||
|
|
f00202d3e3 | ||
|
|
b4d4033040 | ||
|
|
68deb6335e | ||
|
|
cb965a9d3a | ||
|
|
86262ef424 | ||
|
|
acfa4856b9 | ||
|
|
be8711a7e6 | ||
|
|
7e6a0ff51e | ||
|
|
c989e10293 | ||
|
|
b04d809478 | ||
|
|
219276c182 | ||
|
|
64ff652330 | ||
|
|
75e3ca80bc | ||
|
|
aa48b6f714 | ||
|
|
2603a2e4fd | ||
|
|
05550e7c66 | ||
|
|
99349445b1 | ||
|
|
d768dd0125 | ||
|
|
e376d9156b | ||
|
|
85349b801f | ||
|
|
41d1be9f34 | ||
|
|
ac19d5bfaf | ||
|
|
ae7d005dfc | ||
|
|
04427d962d | ||
|
|
57bc2f6ffb | ||
|
|
059a6a685b | ||
|
|
4ac77ca819 | ||
|
|
d703e86b4b | ||
|
|
6870a59952 | ||
|
|
721dadd34b | ||
|
|
b7061d3e57 | ||
|
|
2f4099863e | ||
|
|
96e0c59371 | ||
|
|
1e910229a8 | ||
|
|
c74031105a | ||
|
|
279678d726 | ||
|
|
46db32524d | ||
|
|
0563034987 | ||
|
|
0baf32151f | ||
|
|
8bd9eebf1f | ||
|
|
b9a5b85c16 | ||
|
|
c98be1ad12 | ||
|
|
67b1fcec06 | ||
|
|
4643f66d1a | ||
|
|
e3aa857b74 | ||
|
|
350fcbd003 | ||
|
|
c6799b1f41 | ||
|
|
f260ff4299 | ||
|
|
7122b78d60 | ||
|
|
52971cce4c | ||
|
|
5dc77749e7 | ||
|
|
472b3e6fca | ||
|
|
59b4c5bc3d | ||
|
|
f105c6d4e7 | ||
|
|
2e637c4cba | ||
|
|
8d44e61042 | ||
|
|
eac9866b2c | ||
|
|
7ada4aec7b | ||
|
|
dacb11a24c | ||
|
|
5c44041365 | ||
|
|
56b901df8f | ||
|
|
582bd35450 | ||
|
|
6057352d91 | ||
|
|
3b450189bb | ||
|
|
7878c22bbf | ||
|
|
674372dd15 | ||
|
|
af804a9305 | ||
|
|
7e2eff0be7 | ||
|
|
7de999655d | ||
|
|
1b84abfcab | ||
|
|
8286cbf198 | ||
|
|
db7d7c47cb | ||
|
|
9445d6e22c | ||
|
|
209c253e3f | ||
|
|
e449d41158 | ||
|
|
9b4a07a69e | ||
|
|
28766cfe96 | ||
|
|
a95adaf53d | ||
|
|
7ae2112edc | ||
|
|
79b99d358b | ||
|
|
12fedc8ee6 | ||
|
|
27589a4031 | ||
|
|
f12adef20c | ||
|
|
049efb2da8 | ||
|
|
d41b9d61c2 | ||
|
|
71b1f58d41 | ||
|
|
f983186526 | ||
|
|
c726c88f32 | ||
|
|
3cb9ce92bc | ||
|
|
2504797e50 | ||
|
|
67ebb6a498 | ||
|
|
d9e839c91b | ||
|
|
fd65ec9388 | ||
|
|
7a0052ae2f | ||
|
|
ec0e9d7771 | ||
|
|
4325b8151a | ||
|
|
482e406319 | ||
|
|
e421b10a3d | ||
|
|
55c4b01d95 | ||
|
|
a5610cbed1 | ||
|
|
fc9e1be0b3 | ||
|
|
9b9fef57d9 | ||
|
|
99b87f07af | ||
|
|
9a69207087 | ||
|
|
4cfb3889f8 | ||
|
|
0a7f80fb0a | ||
|
|
df66c40aaa | ||
|
|
9b3e4f9034 | ||
|
|
89dad63b0f | ||
|
|
9636231dda | ||
|
|
a2d896ec4e | ||
|
|
66187b25b6 | ||
|
|
f3deab1057 | ||
|
|
5a9f5defc3 | ||
|
|
e43a74ae3f | ||
|
|
06cd95ea65 | ||
|
|
7d088a3f17 | ||
|
|
0ddabfc4ab | ||
|
|
8078626d49 | ||
|
|
ffad7f7365 | ||
|
|
da2f5156b2 | ||
|
|
e3578fe451 | ||
|
|
036c395d3c | ||
|
|
474417efb7 | ||
|
|
23263e537f | ||
|
|
c98cedfc91 | ||
|
|
2228af8148 | ||
|
|
c6bbff5b5e | ||
|
|
1b58ec73aa | ||
|
|
f49164bf76 | ||
|
|
1ae6c346f6 | ||
|
|
45064beb94 | ||
|
|
8bd7d107a8 | ||
|
|
d465c35811 | ||
|
|
fcff387c6a | ||
|
|
513122c74e | ||
|
|
d68521e673 | ||
|
|
c5302ba6b6 | ||
|
|
70352e16a9 | ||
|
|
150ea5489d | ||
|
|
dd4afcfa02 | ||
|
|
a15e2d0bec | ||
|
|
1e7567b332 | ||
|
|
1dba37de1c | ||
|
|
bfdd13a52c | ||
|
|
a26b65f6b3 | ||
|
|
36f12fc250 | ||
|
|
8c253ee6c3 | ||
|
|
fb497cbb65 | ||
|
|
11bacf8e1b | ||
|
|
2599353bc0 | ||
|
|
9f92b788d8 | ||
|
|
c584c82e0d | ||
|
|
aa4803c5a4 | ||
|
|
816556dbb8 | ||
|
|
d9ecc66fb6 | ||
|
|
f333e91d0a | ||
|
|
f87620d145 | ||
|
|
8bd567de14 | ||
|
|
28a61a5d55 | ||
|
|
d25c23dc46 | ||
|
|
481881bdf7 | ||
|
|
44ab43948a | ||
|
|
643c0f0cba | ||
|
|
da0d698fce | ||
|
|
6f1458dea4 | ||
|
|
72e554c612 | ||
|
|
e54a124e71 | ||
|
|
62e6bd03f6 | ||
|
|
be2e765af8 | ||
|
|
c5b95f4bbb | ||
|
|
b8e85ce171 | ||
|
|
a2b093a9a1 | ||
|
|
8481eefe9f | ||
|
|
9f612740f7 | ||
|
|
cb4b62c04b | ||
|
|
c51e257674 | ||
|
|
40ca71a120 | ||
|
|
cc81b58a0e | ||
|
|
70640f232b | ||
|
|
949e910102 | ||
|
|
395aae632d | ||
|
|
ce9ff91f78 | ||
|
|
f1861e5cbe | ||
|
|
79bca55588 | ||
|
|
3e48da364b | ||
|
|
8b88042311 | ||
|
|
352e7d076d | ||
|
|
d4a6887c31 | ||
|
|
6813d3f09b | ||
|
|
81d20479d4 | ||
|
|
1ff53bb1ba | ||
|
|
927a76eb30 | ||
|
|
050abd469f | ||
|
|
127c3bf6e0 | ||
|
|
cbd9da1acf | ||
|
|
71b1425fd5 | ||
|
|
89424f5b25 | ||
|
|
86d31a6e3f | ||
|
|
84265522ed | ||
|
|
662a9ac8f7 | ||
|
|
33068b3d07 | ||
|
|
db9f31cbd1 | ||
|
|
5b3336a997 | ||
|
|
6920d7ce86 | ||
|
|
1da10df16c | ||
|
|
7f2cf89aeb | ||
|
|
3e629f2ac7 | ||
|
|
3c5a13fa39 | ||
|
|
46c26749eb | ||
|
|
a2d8112081 | ||
|
|
bb331ddde1 | ||
|
|
300bc2d4b0 | ||
|
|
f88fba3cbd | ||
|
|
7b58e280a5 | ||
|
|
8dd637646f | ||
|
|
77625cbc89 | ||
|
|
b122da385a | ||
|
|
eac15568e2 | ||
|
|
fb67d391a3 | ||
|
|
7129d57c22 | ||
|
|
9e88fe782a | ||
|
|
91de42214b | ||
|
|
02b82fb567 | ||
|
|
9fc2d82c3b | ||
|
|
1aebe941ef | ||
|
|
9c1b923e99 | ||
|
|
6adda4d4c0 | ||
|
|
5a8f29cbcc | ||
|
|
aa2208afee | ||
|
|
a1e3732cef | ||
|
|
8bb3b4db45 | ||
|
|
240c0124a6 | ||
|
|
52965a2b9d | ||
|
|
bed33dd66b | ||
|
|
c0f3997eaf | ||
|
|
29adf41cc2 | ||
|
|
0f6b274a8e | ||
|
|
34b7d3a84d | ||
|
|
3afbf58c92 | ||
|
|
9193bf8f3f | ||
|
|
2b487789c8 | ||
|
|
6b6ce9bd43 | ||
|
|
fbe4e20182 | ||
|
|
d753eb1861 | ||
|
|
aac2016aa9 | ||
|
|
2ec26f2e77 | ||
|
|
9e48c8a2b0 | ||
|
|
f1ab82a7e8 | ||
|
|
c4a3ecad74 | ||
|
|
844d678cba | ||
|
|
d3c5cc1fe5 | ||
|
|
01cf5ded25 | ||
|
|
399a6c779e | ||
|
|
516cbf29c4 | ||
|
|
63fc3530b9 | ||
|
|
0ae09ac40d | ||
|
|
c9cb0a918b | ||
|
|
c538edd457 | ||
|
|
718f02e0d3 | ||
|
|
f3560b3f22 | ||
|
|
8b18364cfb | ||
|
|
e7ff9bcf14 | ||
|
|
546a888f91 | ||
|
|
b0c3795ac4 | ||
|
|
19f4433ef2 | ||
|
|
b09e63d792 | ||
|
|
5e04bc52bb | ||
|
|
2773f9f10a | ||
|
|
cf183438ee | ||
|
|
c18ad33d44 | ||
|
|
9956130fa2 | ||
|
|
50ad936a80 | ||
|
|
acb4203da5 | ||
|
|
a6e6fbbeb3 | ||
|
|
02e0ab3df8 | ||
|
|
a66df5bf91 | ||
|
|
ef49022f97 | ||
|
|
4d2ff35b88 | ||
|
|
1e08457302 | ||
|
|
59dd3fcfe8 | ||
|
|
35a659b435 | ||
|
|
01fff28591 | ||
|
|
acad9c91d0 | ||
|
|
ea73a5a1e4 | ||
|
|
6c5f273c3f | ||
|
|
512ca45eb9 | ||
|
|
67c3b641c2 | ||
|
|
bb61f41996 | ||
|
|
8dfa7d2c7e | ||
|
|
046ff98055 | ||
|
|
cde89bb093 | ||
|
|
9eb77b093b | ||
|
|
5e40958c3b | ||
|
|
82b1e211f8 | ||
|
|
3fd521bd7d | ||
|
|
cdc0fc4d45 | ||
|
|
43c40b6f3d | ||
|
|
2e5417f5bd | ||
|
|
247cef557f | ||
|
|
0f328b26c0 | ||
|
|
415027eedd | ||
|
|
1223efd9ce | ||
|
|
27e1844bb9 | ||
|
|
054738b20f | ||
|
|
58a60f9e5e | ||
|
|
df413084ff | ||
|
|
b029f4e97e | ||
|
|
4b98bcb536 | ||
|
|
c597bb43ac | ||
|
|
f66017dd16 | ||
|
|
0990c54b02 | ||
|
|
1cf432ed50 | ||
|
|
eb9c5951e6 | ||
|
|
6a1de942e0 | ||
|
|
b62fb2816f | ||
|
|
d3a50832b1 | ||
|
|
d911500226 | ||
|
|
657c31a31b | ||
|
|
851c79f6e6 | ||
|
|
3fedcf496b | ||
|
|
1562106ccd | ||
|
|
90922a746d | ||
|
|
e54906aaf2 | ||
|
|
6f9f05df58 | ||
|
|
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 | ||
|
|
be796b9980 | ||
|
|
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 |
No files matched your search
+2
-2
@@ -57,11 +57,11 @@ function setup ()
|
||||
CROSS_DLL_DIR="$CROSS_DIR/bin"
|
||||
PATH=$CROSS_BIN_DIR:$PATH
|
||||
|
||||
MONO_VERSION=`grep AM_INIT_AUTOMAKE configure.in | cut -d ',' -f 2|tr -d '\)'`
|
||||
MONO_VERSION=`grep AM_INIT_AUTOMAKE configure.in | cut -d ',' -f 2|tr -d '\)'|tr -d '\('`
|
||||
|
||||
if [ -d ./.git ]; then
|
||||
MONO_GIT_COMMIT="`git log -1 --format=format:%t`"
|
||||
MONO_GIT_BRANCH="`git branch|grep '\*'|cut -d ' ' -f 2`"
|
||||
MONO_GIT_BRANCH="`git branch|grep '\*'|cut -d ' ' -f 2|tr -d '\)'|tr -d '\('`"
|
||||
MONO_RELEASE="$MONO_VERSION-$MONO_GIT_BRANCH-$MONO_GIT_COMMIT"
|
||||
else
|
||||
MONO_RELEASE="$MONO_VERSION"
|
||||
|
||||
+129
-10
@@ -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.10.1)
|
||||
AM_INIT_AUTOMAKE(mono,2.10.9)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
API_VER=2.0
|
||||
@@ -78,6 +78,7 @@ esac
|
||||
|
||||
host_win32=no
|
||||
target_win32=no
|
||||
platform_android=no
|
||||
case "$host" in
|
||||
*-mingw*|*-*-cygwin*)
|
||||
AC_DEFINE(HOST_WIN32,1,[Host Platform is Win32])
|
||||
@@ -172,6 +173,41 @@ case "$host" in
|
||||
with_sigaltstack=no
|
||||
use_sigposix=yes
|
||||
;;
|
||||
*-*-linux-android*)
|
||||
host_win32=no
|
||||
platform_android=yes
|
||||
AC_DEFINE(PLATFORM_ANDROID,1,[Targeting the Android platform])
|
||||
AC_DEFINE(TARGET_ANDROID,1,[Targeting the Android platform])
|
||||
|
||||
CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
|
||||
if test "x$disable_munmap" != "xyes"; then
|
||||
CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
|
||||
fi
|
||||
libmono_cflags="-D_REENTRANT"
|
||||
libdl="-ldl"
|
||||
libgc_threads=pthreads
|
||||
use_sigposix=yes
|
||||
|
||||
with_tls=pthread
|
||||
with_sigaltstack=no
|
||||
with_static_mono=no
|
||||
|
||||
# Android doesn't support boehm, as it's missing <link.h>
|
||||
support_boehm=no
|
||||
with_gc=sgen
|
||||
|
||||
# isinf(3) requires -lm; see isinf check below
|
||||
LDFLAGS="$LDFLAGS -lm"
|
||||
|
||||
# Bionic's <pthread.h> sets PTHREAD_STACK_MIN=2*PAGE_SIZE; doesn't define
|
||||
# PAGE_SIZE; breaks mono/io-layer/collection.c
|
||||
# Bionic doesn't provide S_IWRITE; breaks io-layer/io.c
|
||||
CFLAGS="$CFLAGS -DPAGE_SIZE=4096 -DS_IWRITE=S_IWUSR"
|
||||
CXXFLAGS="$CXXFLAGS -DPAGE_SIZE=4096 -DS_IWRITE=S_IWUSR"
|
||||
|
||||
# to bypass the underscore linker check, can't work when cross-compiling
|
||||
mono_cv_uscore=yes
|
||||
;;
|
||||
*-*-linux*)
|
||||
host_win32=no
|
||||
CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
|
||||
@@ -248,12 +284,12 @@ case "$host" in
|
||||
if test "x$cross_compiling" = "xyes"; then
|
||||
has_broken_apple_cpp=yes
|
||||
fi
|
||||
dnl Snow Leopard is horribly broken -- it reports itself as i386-apple-darwin10.0.0, but
|
||||
dnl Snow Leopard is horribly broken -- it reports itself as i386-apple-darwin*, but
|
||||
dnl its gcc defaults to 64-bit mode. They have also deprecated the usage of ucontext
|
||||
dnl we need to set some flags to build our 32-bit binaries on 10.6 properly
|
||||
case "$host" in
|
||||
dnl Snow Leopard config.guess reports as this
|
||||
i*86-*-darwin10*)
|
||||
dnl Snow Leopard and newer config.guess reports as this
|
||||
i*86-*-darwin*)
|
||||
BROKEN_DARWIN_FLAGS="-arch i386 -D_XOPEN_SOURCE -mmacosx-version-min=10.5"
|
||||
CPPFLAGS="$CPPFLAGS $BROKEN_DARWIN_FLAGS"
|
||||
CFLAGS="$CFLAGS $BROKEN_DARWIN_FLAGS"
|
||||
@@ -294,6 +330,7 @@ AM_CONDITIONAL(TARGET_WIN32, test x$target_win32 = xyes)
|
||||
AM_CONDITIONAL(PLATFORM_LINUX, echo x$target_os | grep -q linux)
|
||||
AM_CONDITIONAL(PLATFORM_DARWIN, test x$platform_darwin = xyes)
|
||||
AM_CONDITIONAL(PLATFORM_SIGPOSIX, test x$use_sigposix = xyes)
|
||||
AM_CONDITIONAL(PLATFORM_ANDROID, test x$platform_android = xyes)
|
||||
|
||||
AC_CHECK_TOOL(CC, gcc, gcc)
|
||||
AC_PROG_CC
|
||||
@@ -443,6 +480,20 @@ if test x"$GCC" = xyes; then
|
||||
AC_MSG_RESULT(no)
|
||||
CFLAGS=$ORIG_CFLAGS
|
||||
])
|
||||
|
||||
ORIG_CFLAGS=$CFLAGS
|
||||
# Check for the normal version, since gcc ignores unknown -Wno options
|
||||
CFLAGS="$CFLAGS -Wunused-but-set-variable"
|
||||
AC_MSG_CHECKING(for -Wno-unused-but-set-variable option to gcc)
|
||||
AC_TRY_COMPILE([], [
|
||||
void main () { }
|
||||
], [
|
||||
AC_MSG_RESULT(yes)
|
||||
CFLAGS="$ORIG_CFLAGS -Wno-unused-but-set-variable"
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
CFLAGS=$ORIG_CFLAGS
|
||||
])
|
||||
else
|
||||
# The Sun Forte compiler complains about inline functions that access static variables
|
||||
# so disable all inlining.
|
||||
@@ -657,7 +708,7 @@ DISABLED_FEATURES=none
|
||||
|
||||
AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems.
|
||||
LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug,
|
||||
reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, normalization, assembly_remapping.],
|
||||
reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, normalization, assembly_remapping, shared_perfcounters.],
|
||||
[
|
||||
for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
|
||||
eval "mono_feature_disable_$feature='yes'"
|
||||
@@ -782,6 +833,11 @@ if test "x$mono_feature_disable_assembly_remapping" = "xyes"; then
|
||||
AC_MSG_NOTICE([Disabled Assembly remapping.])
|
||||
fi
|
||||
|
||||
if test "x$mono_feature_disable_shared_perfcounters" = "xyes"; then
|
||||
AC_DEFINE(DISABLE_SHARED_PERFCOUNTERS, 1, [Disable shared perfcounters.])
|
||||
AC_MSG_NOTICE([Disabled Shared perfcounters.])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for visibility __attribute__)
|
||||
AC_TRY_COMPILE([], [
|
||||
void __attribute__ ((visibility ("hidden"))) doit (void) {}
|
||||
@@ -813,6 +869,9 @@ if test x$enable_parallel_mark = xyes; then
|
||||
libgc_configure_args="$libgc_configure_args --enable-parallel-mark"
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(boehm, [ --disable-boehm Disable the Boehm GC.], support_boehm=$enableval,support_boehm=${support_boehm:-yes})
|
||||
AM_CONDITIONAL(SUPPORT_BOEHM, test x$support_boehm = xyes)
|
||||
|
||||
dnl
|
||||
dnl Boehm GC configuration
|
||||
dnl
|
||||
@@ -1560,6 +1619,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 ******************************
|
||||
@@ -2040,9 +2105,13 @@ if test "x$enable_llvm" = "xyes"; then
|
||||
llvm_version=`$LLVM_CONFIG --version`
|
||||
major_version=`echo $llvm_version | cut -c 1`
|
||||
minor_version=`echo $llvm_version | cut -c 3`
|
||||
AC_MSG_CHECKING(LLVM version)
|
||||
AC_MSG_RESULT($llvm_version)
|
||||
if echo $llvm_version | grep -q 'mono'; then
|
||||
AC_DEFINE(LLVM_MONO_BRANCH, 1, [Whenever we are using the mono branch of LLVM])
|
||||
LLVM_CXXFLAGS="$LLVM_CXXFLAGS -DLLVM_MONO_BRANCH"
|
||||
else
|
||||
AC_MSG_ERROR([Compiling with stock LLVM is not supported, please use the Mono LLVM repo at https://github.com/mono/llvm, with the GIT branch which matches this version of mono, i.e. 'mono-2-10' for Mono 2.10.])
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(LLVM_MAJOR_VERSION, $major_version, [Major version of LLVM libraries])
|
||||
@@ -2262,8 +2331,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*)
|
||||
@@ -2296,12 +2367,12 @@ case "$host" in
|
||||
esac
|
||||
|
||||
if test "x$host" != "x$target"; then
|
||||
AC_DEFINE(MONO_CROSS_COMPILE,1,[The runtime is compiled for cross-compiling mode])
|
||||
case "$target" in
|
||||
powerpc64-ps3-linux-gnu)
|
||||
TARGET=POWERPC64
|
||||
arch_target=powerpc64
|
||||
AC_DEFINE(TARGET_PS3, 1, [...])
|
||||
AC_DEFINE(MONO_CROSS_COMPILE,1,[The runtime is compiled for cross-compiling mode])
|
||||
# It would be better to just use TARGET_POWERPC64, but lots of code already
|
||||
# uses this define
|
||||
AC_DEFINE(__mono_ppc64__, 1, [...])
|
||||
@@ -2314,7 +2385,6 @@ if test "x$host" != "x$target"; then
|
||||
TARGET=POWERPC64
|
||||
arch_target=powerpc64
|
||||
AC_DEFINE(TARGET_XBOX360, 1, [...])
|
||||
AC_DEFINE(MONO_CROSS_COMPILE,1,[The runtime is compiled for cross-compiling mode])
|
||||
# It would be better to just use TARGET_POWERPC64, but lots of code already
|
||||
# uses this define
|
||||
sizeof_register=8
|
||||
@@ -2324,12 +2394,49 @@ if test "x$host" != "x$target"; then
|
||||
TARGET=AMD64
|
||||
arch_target=amd64
|
||||
AC_DEFINE(TARGET_AMD64, 1, [...])
|
||||
AC_DEFINE(MONO_CROSS_COMPILE,1,[The runtime is compiled for cross-compiling mode])
|
||||
AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers])
|
||||
sizeof_register=8
|
||||
;;
|
||||
armv7l-unknown-linux-gnueabi*)
|
||||
# TEGRA
|
||||
TARGET=ARM;
|
||||
arch_target=arm;
|
||||
AC_DEFINE(TARGET_ARM, 1, [...])
|
||||
ACCESS_UNALIGNED="no"
|
||||
JIT_SUPPORTED=yes
|
||||
CPPFLAGS="$CPPFLAGS -DARM_FPU_VFP=1 -D__ARM_EABI__"
|
||||
jit_wanted=true
|
||||
# Can't use tls, since it depends on the runtime detection of tls offsets
|
||||
# in mono-compiler.h
|
||||
with_tls=pthread
|
||||
;;
|
||||
armv5tel-unknown-linux-gnueabi*)
|
||||
TARGET=ARM;
|
||||
arch_target=arm;
|
||||
AC_DEFINE(TARGET_ARM, 1, [...])
|
||||
ACCESS_UNALIGNED="no"
|
||||
JIT_SUPPORTED=yes
|
||||
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
|
||||
jit_wanted=true
|
||||
# Can't use tls, since it depends on the runtime detection of tls offsets
|
||||
# in mono-compiler.h
|
||||
with_tls=pthread
|
||||
;;
|
||||
armv5-*-linux-androideabi*)
|
||||
TARGET=ARM;
|
||||
arch_target=arm;
|
||||
AC_DEFINE(TARGET_ARM, 1, [...])
|
||||
AC_DEFINE(TARGET_ANDROID, 1, [...])
|
||||
ACCESS_UNALIGNED="no"
|
||||
JIT_SUPPORTED=yes
|
||||
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__ -DARM_FPU_NONE=1"
|
||||
jit_wanted=true
|
||||
# Can't use tls, since it depends on the runtime detection of tls offset
|
||||
# in mono-compiler.h
|
||||
with_tls=pthread
|
||||
;;
|
||||
*)
|
||||
AC_MSG_WARN([Cross compiling is only supported for targets matching 'powerpc64-{ps3,xbox360}-linux-gnu'])
|
||||
AC_MSG_ERROR([Cross compiling is not supported for target $target])
|
||||
esac
|
||||
fi
|
||||
|
||||
@@ -2561,6 +2668,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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<dllmap dll="sqlite3" target="@SQLITE3@" os="!windows"/>
|
||||
<dllmap dll="libX11" target="@X11@" os="!windows" />
|
||||
<dllmap dll="libcairo-2.dll" target="libcairo.so.2" os="!windows"/>
|
||||
<dllmap dll="libcairo-2.dll" target="libcairo.2.dylib" os="osx"/>
|
||||
<dllmap dll="libcups" target="libcups.so.2" os="!windows"/>
|
||||
<dllmap dll="libcups" target="libcups.dylib" os="osx"/>
|
||||
<dllmap dll="i:kernel32.dll">
|
||||
|
||||
@@ -40,6 +40,7 @@ AM_CONDITIONAL(CROSS_COMPILING, [test x$cross_compiling = xyes])
|
||||
AC_C_BIGENDIAN([ORDER=G_BIG_ENDIAN],[ORDER=G_LITTLE_ENDIAN])
|
||||
|
||||
platform_darwin=no
|
||||
platform_android=no
|
||||
|
||||
case $host in
|
||||
*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
|
||||
@@ -55,6 +56,14 @@ case $host in
|
||||
OS="UNIX"
|
||||
PIDTYPE='int'
|
||||
;;
|
||||
*-*-linux-android*)
|
||||
platform_android=yes
|
||||
AC_DEFINE(PLATFORM_ANDROID,1,[Targeting the Android platform])
|
||||
PATHSEP='/'
|
||||
SEARCHSEP=':'
|
||||
OS="UNIX"
|
||||
PIDTYPE='int'
|
||||
;;
|
||||
*)
|
||||
PATHSEP='/'
|
||||
SEARCHSEP=':'
|
||||
@@ -91,6 +100,7 @@ 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)
|
||||
AM_CONDITIONAL(PLATFORM_ANDROID, test x$platform_android = xyes)
|
||||
|
||||
AC_CHECK_SIZEOF(int)
|
||||
AC_CHECK_SIZEOF(void *)
|
||||
|
||||
@@ -61,6 +61,10 @@ INCLUDES = -I$(srcdir)
|
||||
|
||||
if HOST_WIN32
|
||||
libeglib_la_LIBADD = -lm $(ICONV_LIBS) -lpsapi
|
||||
else
|
||||
if PLATFORM_ANDROID
|
||||
libeglib_la_LIBADD = -llog
|
||||
endif
|
||||
endif
|
||||
|
||||
libeglib_static_la_LIBADD = $(libeglib_la_LIBADD)
|
||||
|
||||
@@ -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
|
||||
@@ -72,5 +70,4 @@ int vasprintf(char **ret, const char *fmt, va_list ap);
|
||||
#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;
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
|
||||
#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)
|
||||
{
|
||||
|
||||
+9
-1
@@ -40,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
|
||||
*/
|
||||
@@ -108,7 +114,9 @@ typedef int32_t gboolean;
|
||||
|
||||
#define G_USEC_PER_SEC 1000000
|
||||
|
||||
#ifndef ABS
|
||||
#define ABS(a) ((a) > 0 ? (a) : -(a))
|
||||
#endif
|
||||
|
||||
#define G_STRUCT_OFFSET(p_type,field) offsetof(p_type,field)
|
||||
|
||||
@@ -669,7 +677,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
|
||||
|
||||
@@ -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);
|
||||
|
||||
+8
-9
@@ -24,6 +24,7 @@
|
||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <glib.h>
|
||||
@@ -111,28 +112,26 @@ g_log_set_fatal_mask (const gchar *log_domain, GLogLevelFlags fatal_mask)
|
||||
void
|
||||
g_logv (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, va_list args)
|
||||
{
|
||||
#if PLATFORM_ANDROID
|
||||
__android_log_vprint (to_android_priority (log_level), log_domain, format, args);
|
||||
#else
|
||||
char *msg;
|
||||
|
||||
vasprintf (&msg, format, args);
|
||||
#if PLATFORM_ANDROID
|
||||
__android_log_print (to_android_priority (log_level),
|
||||
/* TODO: provide a proper app name */
|
||||
"mono", "%s%s%s",
|
||||
log_domain != NULL ? log_domain : "",
|
||||
log_domain != NULL ? ": " : "",
|
||||
msg);
|
||||
#else
|
||||
printf ("%s%s%s\n",
|
||||
log_domain != NULL ? log_domain : "",
|
||||
log_domain != NULL ? ": " : "",
|
||||
msg);
|
||||
#endif
|
||||
free (msg);
|
||||
if (log_level & fatal){
|
||||
fflush (stdout);
|
||||
fflush (stderr);
|
||||
abort ();
|
||||
}
|
||||
#endif
|
||||
if (log_level & fatal){
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
+3
-1
@@ -68,7 +68,9 @@ g_build_path (const gchar *separator, const gchar *first_element, ...)
|
||||
g_string_append_len (result, s, p - s);
|
||||
|
||||
if (next && *next){
|
||||
if (strncmp (separator, result->str + strlen (result->str) - slen, slen))
|
||||
int reslen = strlen (result->str);
|
||||
|
||||
if (reslen >= slen && strncmp (separator, result->str + reslen - slen, slen))
|
||||
g_string_append (result, separator);
|
||||
|
||||
for (; strncmp (next, separator, slen) == 0; )
|
||||
|
||||
+2
-2
@@ -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 ("");
|
||||
}
|
||||
@@ -225,7 +225,7 @@ g_shell_unquote (const gchar *quoted_string, GError **error)
|
||||
}
|
||||
} else if (*p == '\\'){
|
||||
char c = *(++p);
|
||||
if (!(c == '$' || c == '"' || c == '\\' || c == '`' || c == 0))
|
||||
if (!(c == '$' || c == '"' || c == '\\' || c == '`' || c == '\'' || c == 0 ))
|
||||
g_string_append_c (result, '\\');
|
||||
if (c == 0)
|
||||
break;
|
||||
|
||||
+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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -569,6 +569,9 @@ void GC_stop_world()
|
||||
thread_act_array_t act_list, prev_list;
|
||||
mach_msg_type_number_t listcount, prevcount;
|
||||
|
||||
if (GC_notify_event)
|
||||
GC_notify_event (GC_EVENT_PRE_STOP_WORLD);
|
||||
|
||||
# if DEBUG_THREADS
|
||||
GC_printf1("Stopping the world from 0x%lx\n", mach_thread_self());
|
||||
# endif
|
||||
@@ -639,6 +642,9 @@ void GC_stop_world()
|
||||
#endif
|
||||
|
||||
mach_port_deallocate(my_task, my_thread);
|
||||
|
||||
if (GC_notify_event)
|
||||
GC_notify_event (GC_EVENT_POST_STOP_WORLD);
|
||||
}
|
||||
|
||||
/* Caller holds allocation lock, and has held it continuously since */
|
||||
@@ -654,6 +660,9 @@ void GC_start_world()
|
||||
mach_msg_type_number_t listcount;
|
||||
struct thread_basic_info info;
|
||||
mach_msg_type_number_t outCount = THREAD_INFO_MAX;
|
||||
|
||||
if (GC_notify_event)
|
||||
GC_notify_event (GC_EVENT_PRE_START_WORLD);
|
||||
|
||||
# if DEBUG_THREADS
|
||||
GC_printf0("World starting\n");
|
||||
@@ -700,6 +709,10 @@ void GC_start_world()
|
||||
vm_deallocate(my_task, (vm_address_t)act_list, sizeof(thread_t) * listcount);
|
||||
|
||||
mach_port_deallocate(my_task, my_thread);
|
||||
|
||||
if (GC_notify_event)
|
||||
GC_notify_event (GC_EVENT_POST_START_WORLD);
|
||||
|
||||
# if DEBUG_THREADS
|
||||
GC_printf0("World started\n");
|
||||
# endif
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -371,6 +371,8 @@ void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES]));
|
||||
# define GC_MACH_THREAD_STATE_FLAVOR PPC_THREAD_STATE
|
||||
# elif defined(I386)
|
||||
# define GC_MACH_THREAD_STATE_FLAVOR i386_THREAD_STATE
|
||||
# elif defined(X86_64)
|
||||
# define GC_MACH_THREAD_STATE_FLAVOR x86_THREAD_STATE64
|
||||
# else
|
||||
# define GC_MACH_THREAD_STATE_FLAVOR MACHINE_THREAD_STATE
|
||||
# endif
|
||||
|
||||
+8
-1
@@ -2131,7 +2131,14 @@ void GC_unmap_gap(ptr_t start1, word bytes1, ptr_t start2, word bytes2)
|
||||
len -= free_len;
|
||||
}
|
||||
# else
|
||||
if (len != 0 && munmap(start_addr, len) != 0) ABORT("munmap failed");
|
||||
if (len != 0) {
|
||||
/* Immediately remap as above. */
|
||||
void * result;
|
||||
result = mmap(start_addr, len, PROT_NONE,
|
||||
MAP_PRIVATE | MAP_FIXED | OPT_MAP_ANON,
|
||||
zero_fd, 0/* offset */);
|
||||
if (result != (void *)start_addr) ABORT("mmap(...PROT_NONE...) failed");
|
||||
}
|
||||
GC_unmapped_bytes += len;
|
||||
# endif
|
||||
}
|
||||
|
||||
@@ -729,7 +729,7 @@ void nacl_shutdown_gc_thread()
|
||||
/* Caller holds allocation lock. */
|
||||
GC_thread GC_new_thread(pthread_t id)
|
||||
{
|
||||
int hv = ((word)id) % THREAD_TABLE_SZ;
|
||||
int hv = ((unsigned long)id) % THREAD_TABLE_SZ;
|
||||
GC_thread result;
|
||||
static GC_bool first_thread_used = FALSE;
|
||||
|
||||
@@ -760,7 +760,7 @@ GC_thread GC_new_thread(pthread_t id)
|
||||
/* Caller holds allocation lock. */
|
||||
void GC_delete_thread(pthread_t id)
|
||||
{
|
||||
int hv = ((word)id) % THREAD_TABLE_SZ;
|
||||
int hv = ((unsigned long)id) % THREAD_TABLE_SZ;
|
||||
register GC_thread p = GC_threads[hv];
|
||||
register GC_thread prev = 0;
|
||||
|
||||
@@ -796,7 +796,7 @@ void GC_delete_thread(pthread_t id)
|
||||
/* This is OK, but we need a way to delete a specific one. */
|
||||
void GC_delete_gc_thread(pthread_t id, GC_thread gc_id)
|
||||
{
|
||||
int hv = ((word)id) % THREAD_TABLE_SZ;
|
||||
int hv = ((unsigned long)id) % THREAD_TABLE_SZ;
|
||||
register GC_thread p = GC_threads[hv];
|
||||
register GC_thread prev = 0;
|
||||
|
||||
@@ -825,7 +825,7 @@ void GC_delete_gc_thread(pthread_t id, GC_thread gc_id)
|
||||
/* return the most recent one. */
|
||||
GC_thread GC_lookup_thread(pthread_t id)
|
||||
{
|
||||
int hv = ((word)id) % THREAD_TABLE_SZ;
|
||||
int hv = ((unsigned long)id) % THREAD_TABLE_SZ;
|
||||
register GC_thread p = GC_threads[hv];
|
||||
|
||||
while (p != 0 && !pthread_equal(p -> id, id)) p = p -> next;
|
||||
|
||||
+11
-1
@@ -1038,7 +1038,7 @@ method. The right option, unfortunately, requires experimentation.
|
||||
When using Mono with the SGen garbage collector this environment
|
||||
variable can be used to turn on various debugging features of the
|
||||
collector. The value of this variable is a comma separated list of
|
||||
words.
|
||||
words. Do not use these options in production.
|
||||
.RS
|
||||
.ne 8
|
||||
.TP
|
||||
@@ -1063,6 +1063,13 @@ This clears the nursery at GC time instead of doing it when the thread
|
||||
local allocation buffer (TLAB) is created. The default is to clear
|
||||
the nursery at TLAB creation time.
|
||||
.TP
|
||||
\fBdisable-minor\fR
|
||||
Don't do minor collections. If the nursery is full, a major collection
|
||||
is triggered instead, unless it, too, is disabled.
|
||||
.TP
|
||||
\fBdisable-major\fR
|
||||
Don't do major collections.
|
||||
.TP
|
||||
\fBconservative-stack-mark\fR
|
||||
Forces the GC to scan the stack conservatively, even if precise
|
||||
scanning is available.
|
||||
@@ -1403,6 +1410,9 @@ be used when writing messages like this: Console.Error:MyProgramName.
|
||||
See the System.Diagnostics.DefaultTraceListener documentation for more
|
||||
information.
|
||||
.TP
|
||||
\fBMONO_WCF_TRACE\fR
|
||||
This eases WCF diagnostics functionality by simply outputs all log messages from WCF engine to "stdout", "stderr" or any file passed to this environment variable. The log format is the same as usual diagnostic output.
|
||||
.TP
|
||||
\fBMONO_XEXCEPTIONS\fR
|
||||
This throws an exception when a X11 error is encountered; by default a
|
||||
message is displayed but execution continues
|
||||
|
||||
+70
-3
@@ -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
|
||||
@@ -82,6 +106,49 @@ Anywhere else in the project files, $(MSBuildExtensionsPath) will always resolve
|
||||
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
|
||||
@@ -119,7 +186,7 @@ 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
|
||||
|
||||
@@ -26,6 +26,8 @@ PLATFORM_MAKE_CORLIB_CMP = yes
|
||||
PLATFORM_CHANGE_SEPARATOR_CMD=tr '/' '\\\\'
|
||||
PLATFORM_PATH_SEPARATOR = ;
|
||||
|
||||
override CURDIR:=$(shell cygpath -m $(CURDIR))
|
||||
|
||||
## not so simple :-)
|
||||
#PLATFORM_AOT_SUFFIX = .dll
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ EXTRA_DISTFILES = \
|
||||
$(RESOURCE_FILES)
|
||||
|
||||
Commons.Xml.Relaxng.Rnc/RncParser.cs: Commons.Xml.Relaxng.Rnc/RncParser.jay $(topdir)/jay/skeleton.cs
|
||||
$(topdir)/jay/jay -ctv < $(topdir)/jay/skeleton.cs Commons.Xml.Relaxng.Rnc/RncParser.jay > Commons.Xml.Relaxng.Rnc/RncParser.cs
|
||||
$(topdir)/jay/jay -ctv < $(topdir)/jay/skeleton.cs $(CURDIR)/Commons.Xml.Relaxng.Rnc/RncParser.jay > Commons.Xml.Relaxng.Rnc/RncParser.cs
|
||||
|
||||
BUILT_SOURCES = Commons.Xml.Relaxng.Rnc/RncParser.cs
|
||||
|
||||
|
||||
@@ -144,6 +144,7 @@ mobile_dirs := \
|
||||
System.Transactions \
|
||||
System.Data \
|
||||
Mono.Cairo \
|
||||
System.Numerics \
|
||||
Mono.Data.Sqlite
|
||||
|
||||
net_3_5_only_dirs := \
|
||||
@@ -156,6 +157,7 @@ net_4_0_dirs := \
|
||||
System.Dynamic \
|
||||
System.Numerics \
|
||||
Microsoft.CSharp \
|
||||
Microsoft.Build \
|
||||
System.Windows.Forms.DataVisualization \
|
||||
System.ComponentModel.Composition \
|
||||
System.Xaml \
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -35,9 +35,9 @@ namespace Microsoft.Build.BuildEngine {
|
||||
internal class BuildChoose {
|
||||
|
||||
BuildWhen otherwise;
|
||||
Project project;
|
||||
ImportedProject importedProject;
|
||||
XmlElement xmlElement;
|
||||
//Project project;
|
||||
//ImportedProject importedProject;
|
||||
//XmlElement xmlElement;
|
||||
List <BuildWhen> whens;
|
||||
|
||||
public BuildChoose (XmlElement xmlElement, Project project)
|
||||
@@ -47,9 +47,9 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
internal BuildChoose (XmlElement xmlElement, Project project, ImportedProject importedProject)
|
||||
{
|
||||
this.xmlElement = xmlElement;
|
||||
this.project = project;
|
||||
this.importedProject = importedProject;
|
||||
//this.xmlElement = xmlElement;
|
||||
//this.project = project;
|
||||
//this.importedProject = importedProject;
|
||||
this.whens = new List <BuildWhen> ();
|
||||
|
||||
foreach (XmlNode xn in xmlElement.ChildNodes) {
|
||||
|
||||
@@ -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
-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];
|
||||
|
||||
@@ -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)
|
||||
@@ -607,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 ()
|
||||
@@ -779,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; }
|
||||
|
||||
@@ -45,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;
|
||||
@@ -73,7 +73,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
public Engine (ToolsetDefinitionLocations locations)
|
||||
: this (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20))
|
||||
{
|
||||
toolsetLocations = locations;
|
||||
//toolsetLocations = locations;
|
||||
}
|
||||
|
||||
public Engine (BuildPropertyGroup globalProperties)
|
||||
@@ -86,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
|
||||
@@ -229,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 ();
|
||||
|
||||
@@ -366,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)
|
||||
@@ -397,10 +437,7 @@ 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)
|
||||
@@ -518,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
|
||||
@@ -66,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
|
||||
//
|
||||
|
||||
@@ -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
|
||||
@@ -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,13 @@
|
||||
#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 {
|
||||
@@ -47,6 +52,11 @@ namespace Microsoft.Build.BuildEngine {
|
||||
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");
|
||||
@@ -61,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>.");
|
||||
@@ -73,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);
|
||||
@@ -93,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 (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});
|
||||
|
||||
string [] paths = envvar.Split (new char [] {Path.PathSeparator}, StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach (string path in paths) {
|
||||
if (!Directory.Exists (path)) {
|
||||
project.ParentEngine.LogMessage (MessageImportance.Low, "Extension path '{0}' not found, ignoring.", path);
|
||||
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 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");
|
||||
@@ -196,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;
|
||||
@@ -141,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 ();
|
||||
}
|
||||
@@ -274,7 +276,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
{
|
||||
return Build (targetNames, targetOutputs, BuildSettings.None);
|
||||
}
|
||||
|
||||
|
||||
[MonoTODO ("Not tested")]
|
||||
public bool Build (string [] targetNames,
|
||||
IDictionary targetOutputs,
|
||||
@@ -295,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;
|
||||
@@ -314,7 +323,11 @@ namespace Microsoft.Build.BuildEngine {
|
||||
needToReevaluate = false;
|
||||
Reevaluate ();
|
||||
}
|
||||
|
||||
|
||||
#if NET_4_0
|
||||
ProcessBeforeAndAfterTargets ();
|
||||
#endif
|
||||
|
||||
if (targetNames == null || targetNames.Length == 0) {
|
||||
if (defaultTargets != null && defaultTargets.Length != 0) {
|
||||
targetNames = defaultTargets;
|
||||
@@ -338,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;
|
||||
}
|
||||
@@ -388,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)
|
||||
{
|
||||
@@ -474,6 +529,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
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);
|
||||
@@ -879,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);
|
||||
@@ -929,6 +985,7 @@ 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);
|
||||
@@ -967,10 +1024,9 @@ namespace Microsoft.Build.BuildEngine {
|
||||
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 ("MSBuildToolsRoot", Path.GetDirectoryName (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));
|
||||
SetExtensionsPathProperties (DefaultExtensionsPath);
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectDefaultTargets", DefaultTargets, PropertyType.Reserved));
|
||||
evaluatedProperties.AddProperty (new BuildProperty ("OS", OS, PropertyType.Environment));
|
||||
|
||||
@@ -989,6 +1045,15 @@ namespace Microsoft.Build.BuildEngine {
|
||||
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
|
||||
@@ -1035,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) {
|
||||
@@ -1059,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);
|
||||
@@ -1325,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
|
||||
|
||||
@@ -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;
|
||||
@@ -157,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) {
|
||||
@@ -174,41 +176,80 @@ namespace Microsoft.Build.BuildEngine {
|
||||
project.PopBatch ();
|
||||
}
|
||||
|
||||
project.ParentEngine.BuiltTargetsOutputByName [built_targets_key] = (ITaskItem[]) Outputs.Clone ();
|
||||
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");
|
||||
}
|
||||
@@ -321,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; }
|
||||
}
|
||||
@@ -333,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);
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
@@ -2104,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");
|
||||
@@ -2265,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
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -23,9 +23,11 @@ Microsoft.Build.Framework/IBuildEngine.cs
|
||||
Microsoft.Build.Framework/IBuildEngine2.cs
|
||||
Microsoft.Build.Framework/IEventSource.cs
|
||||
Microsoft.Build.Framework/ILogger.cs
|
||||
Microsoft.Build.Framework/INodeLogger.cs
|
||||
Microsoft.Build.Framework/ITask.cs
|
||||
Microsoft.Build.Framework/ITaskHost.cs
|
||||
Microsoft.Build.Framework/ITaskItem.cs
|
||||
Microsoft.Build.Framework/ITaskItem2.cs
|
||||
Microsoft.Build.Framework/LoadInSeparateAppDomainAttribute.cs
|
||||
Microsoft.Build.Framework/LoggerException.cs
|
||||
Microsoft.Build.Framework/LoggerVerbosity.cs
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// INodeLogger.cs:
|
||||
//
|
||||
// Author:
|
||||
// Rolf Bjarne Kvinge ([email protected])
|
||||
//
|
||||
// Copyright (C) 2011 Xamarin Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
|
||||
#if NET_4_0
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace Microsoft.Build.Framework
|
||||
{
|
||||
[System.Runtime.InteropServices.ComVisible (true)]
|
||||
public interface INodeLogger : ILogger
|
||||
{
|
||||
void Initialize (IEventSource eventSource, int nodeCount);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// ITaskItem2.cs:
|
||||
//
|
||||
// Author:
|
||||
// Rolf Bjarne Kvinge ([email protected])
|
||||
//
|
||||
// Copyright (C) 2011 Xamarin Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#if NET_4_0
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace Microsoft.Build.Framework
|
||||
{
|
||||
[System.Runtime.InteropServices.GuidAttribute ("ac6d5a59-f877-461b-88e3-b2f06fce0cb9")]
|
||||
[System.Runtime.InteropServices.ComVisible (true)]
|
||||
public interface ITaskItem2 : ITaskItem
|
||||
{
|
||||
string EvaluatedIncludeEscaped { get; set; }
|
||||
|
||||
string GetMetadataValueEscaped (string metadataName);
|
||||
|
||||
void SetMetadataValueLiteral (string metadataName, string metadataValue);
|
||||
|
||||
IDictionary CloneCustomMetadataEscaped ();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -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
|
||||
|
||||
@@ -37,8 +37,6 @@ using Mono.XBuild.Utilities;
|
||||
namespace Microsoft.Build.Tasks {
|
||||
public class AL : ToolTaskExtension {
|
||||
|
||||
Process alProcess;
|
||||
|
||||
public AL ()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -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])
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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
|
||||
@@ -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 {
|
||||
|
||||
@@ -183,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}");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -148,7 +148,11 @@ namespace MonoTests.Microsoft.Build.Tasks
|
||||
Assert.IsTrue(project.Build("1"), id + "1 : Error in building");
|
||||
|
||||
string [] files = new string [] { "xyz.cs", "rel/bar.resx", "rel/qwe.txt"};
|
||||
string [] assignedFiles = new string [] { "Test/Link/xyz.cs", "Test/Link/bar.resx", "../Test/Link/qwe.txt"};
|
||||
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");
|
||||
@@ -162,6 +166,18 @@ namespace MonoTests.Microsoft.Build.Tasks
|
||||
}
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -119,7 +119,6 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
testLogger.DumpMessages ();
|
||||
Assert.Fail ("Build failed");
|
||||
}
|
||||
testLogger.DumpMessages ();
|
||||
|
||||
Assert.AreEqual (1, testLogger.NormalMessageCount, "Expected number of messages");
|
||||
testLogger.CheckLoggedMessageHead (expected, "A1");
|
||||
|
||||
@@ -95,7 +95,6 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
Assert.Fail ("Build should have failed");
|
||||
}
|
||||
|
||||
testLogger.DumpMessages ();
|
||||
Assert.AreEqual (0, testLogger.CheckAny ("Text1", MessageImportance.Low), "A1");
|
||||
Assert.AreEqual (0, testLogger.CheckAny ("Text2", MessageImportance.Normal), "A2");
|
||||
Assert.AreEqual (0, testLogger.CheckAny ("Text3", MessageImportance.High), "A3");
|
||||
@@ -104,7 +103,6 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
Assert.AreEqual (0, testLogger.CheckAny ("Text6", MessageImportance.High), "A6");
|
||||
Assert.AreEqual (0, testLogger.CheckAny ("Text7", MessageImportance.Normal), "A7");
|
||||
Assert.AreEqual (1, testLogger.CheckAny ("Text8", MessageImportance.Normal), "A8");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -905,7 +905,6 @@ namespace MonoTests.Microsoft.Build.Tasks
|
||||
testLogger.DumpMessages ();
|
||||
Assert.Fail ("Build failed");
|
||||
}
|
||||
testLogger.DumpMessages ();
|
||||
|
||||
try {
|
||||
testLogger.CheckLoggedAny ("For md: 3 Item1: Item1Ref: Item2: Three Item2Ref: Three Prop1: Prop1Ref: Prop2: Three Prop2Ref: Three", MessageImportance.Normal, "A1");
|
||||
|
||||
@@ -69,6 +69,9 @@ namespace MonoTests.Microsoft.Build.Tasks
|
||||
set { task_finished = value; }
|
||||
}
|
||||
|
||||
public int WarningsCount { get; set; }
|
||||
public int ErrorsCount { get; set; }
|
||||
|
||||
public int Count
|
||||
{
|
||||
get { return messages.Count; }
|
||||
@@ -81,14 +84,19 @@ namespace MonoTests.Microsoft.Build.Tasks
|
||||
public void Initialize (IEventSource eventSource)
|
||||
{
|
||||
eventSource.MessageRaised += new BuildMessageEventHandler (MessageHandler);
|
||||
|
||||
eventSource.ErrorRaised += new BuildErrorEventHandler (AllMessagesHandler);
|
||||
eventSource.ErrorRaised += (e,o) => ErrorsCount ++;
|
||||
|
||||
eventSource.WarningRaised += new BuildWarningEventHandler(AllMessagesHandler);
|
||||
eventSource.WarningRaised += (e,o) => WarningsCount ++;
|
||||
|
||||
eventSource.TargetStarted += delegate { target_started++; };
|
||||
eventSource.TargetFinished += delegate { target_finished++; };
|
||||
eventSource.TaskStarted += delegate { task_started++; };
|
||||
eventSource.TaskFinished += delegate { task_finished++; };
|
||||
eventSource.ProjectStarted += delegate(object sender, ProjectStartedEventArgs args) { project_started++; Console.WriteLine ("Project started: {0}", args.ProjectFile); };
|
||||
eventSource.ProjectFinished += delegate (object sender, ProjectFinishedEventArgs args) { project_finished++; Console.WriteLine ("Project finished: {0}", args.ProjectFile); };
|
||||
eventSource.ProjectStarted += delegate(object sender, ProjectStartedEventArgs args) { project_started++; };
|
||||
eventSource.ProjectFinished += delegate (object sender, ProjectFinishedEventArgs args) { project_finished++; };
|
||||
eventSource.BuildStarted += delegate { build_started ++; };
|
||||
eventSource.BuildFinished += delegate { build_finished++; };
|
||||
}
|
||||
|
||||
@@ -114,22 +114,16 @@ namespace Microsoft.Build.Utilities
|
||||
toolOutput = new StringBuilder ();
|
||||
|
||||
try {
|
||||
string arguments = commandLineCommands;
|
||||
string responseFileSwitch = String.Empty;
|
||||
if (!String.IsNullOrEmpty (responseFileCommands)) {
|
||||
responseFileName = Path.GetTempFileName ();
|
||||
File.WriteAllText (responseFileName, responseFileCommands);
|
||||
arguments = arguments + " " + GetResponseFileSwitch (responseFileName);
|
||||
responseFileSwitch = GetResponseFileSwitch (responseFileName);
|
||||
}
|
||||
|
||||
var pinfo = GetProcessStartInfo (pathToTool, commandLineCommands, responseFileSwitch);
|
||||
LogToolCommand (String.Format ("Tool {0} execution started with arguments: {1} {2}",
|
||||
pathToTool, commandLineCommands, responseFileCommands));
|
||||
|
||||
ProcessStartInfo pinfo = new ProcessStartInfo (pathToTool, arguments);
|
||||
pinfo.WorkingDirectory = GetWorkingDirectory () ?? Environment.CurrentDirectory;
|
||||
|
||||
pinfo.UseShellExecute = false;
|
||||
pinfo.RedirectStandardOutput = true;
|
||||
pinfo.RedirectStandardError = true;
|
||||
pinfo.FileName, commandLineCommands, responseFileCommands));
|
||||
|
||||
var pendingLineFragmentOutput = new StringBuilder ();
|
||||
var pendingLineFragmentError = new StringBuilder ();
|
||||
@@ -264,7 +258,7 @@ namespace Microsoft.Build.Utilities
|
||||
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}");
|
||||
@@ -298,6 +292,18 @@ namespace Microsoft.Build.Utilities
|
||||
return String.Format ("@{0}", responseFilePath);
|
||||
}
|
||||
|
||||
protected virtual ProcessStartInfo GetProcessStartInfo (string pathToTool, string commandLineCommands, string responseFileSwitch)
|
||||
{
|
||||
var pinfo = new ProcessStartInfo (pathToTool, String.Format ("{0} {1}", commandLineCommands, responseFileSwitch));
|
||||
|
||||
pinfo.WorkingDirectory = GetWorkingDirectory () ?? Environment.CurrentDirectory;
|
||||
pinfo.UseShellExecute = false;
|
||||
pinfo.RedirectStandardOutput = true;
|
||||
pinfo.RedirectStandardError = true;
|
||||
|
||||
return pinfo;
|
||||
}
|
||||
|
||||
protected virtual bool HandleTaskExecutionErrors ()
|
||||
{
|
||||
if (!Log.HasLoggedErrors && exitCode != 0)
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
obj/
|
||||
bin/
|
||||
*.vs10x
|
||||
*.docstates
|
||||
*.suo
|
||||
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// AssemblyInfo.cs
|
||||
//
|
||||
// Author:
|
||||
// Leszek Ciesielski ([email protected])
|
||||
//
|
||||
// (C) 2011 Leszek Ciesielski
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime;
|
||||
using System.Security;
|
||||
using System.Security.Permissions;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
// General Information about the Microsoft.Build assembly
|
||||
|
||||
[assembly: AssemblyTitle ("Microsoft.Build.dll")]
|
||||
[assembly: AssemblyDescription ("Microsoft.Build.dll")]
|
||||
[assembly: AssemblyDefaultAlias ("Microsoft.Build.dll")]
|
||||
|
||||
[assembly: AssemblyCompany (Consts.MonoCompany)]
|
||||
[assembly: AssemblyProduct (Consts.MonoProduct)]
|
||||
[assembly: AssemblyCopyright (Consts.MonoCopyright)]
|
||||
[assembly: AssemblyVersion (Consts.FxVersion)]
|
||||
[assembly: SatelliteContractVersion (Consts.FxVersion)]
|
||||
[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
|
||||
|
||||
[assembly: NeutralResourcesLanguage ("en-US")]
|
||||
|
||||
[assembly: ComVisible (false)]
|
||||
[assembly: CLSCompliant (true)]
|
||||
[assembly: AssemblyDelaySign (true)]
|
||||
[assembly: AssemblyKeyFile("../msfinal.pub")]
|
||||
|
||||
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
|
||||
[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
|
||||
[assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
|
||||
[assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)]
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
thisdir = class/Microsoft.Build
|
||||
SUBDIRS =
|
||||
include ../../build/rules.make
|
||||
|
||||
LIBRARY = Microsoft.Build.dll
|
||||
|
||||
ifneq (4.0, $(FRAMEWORK_VERSION))
|
||||
LIBRARY_NAME = dummy-Microsoft.Build.dll
|
||||
NO_INSTALL = yes
|
||||
NO_TEST = yes
|
||||
NO_SIGN_ASSEMBLY = yes
|
||||
endif
|
||||
|
||||
LIB_MCS_FLAGS = \
|
||||
/r:$(corlib) \
|
||||
/r:System.dll \
|
||||
/r:System.Core.dll \
|
||||
/r:System.Xml.dll \
|
||||
/r:Microsoft.Build.Engine.dll \
|
||||
/r:Microsoft.Build.Framework.dll
|
||||
|
||||
include ../../build/library.make
|
||||
|
||||
export TESTING_MONO=a
|
||||
XBUILD_DIR=../../tools/xbuild
|
||||
include $(XBUILD_DIR)/xbuild_targets.make
|
||||
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// ProjectChooseElement.cs
|
||||
//
|
||||
// Author:
|
||||
// Leszek Ciesielski ([email protected])
|
||||
//
|
||||
// (C) 2011 Leszek Ciesielski
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Build.Exceptions;
|
||||
using Microsoft.Build.Internal;
|
||||
|
||||
namespace Microsoft.Build.Construction
|
||||
{
|
||||
[System.Diagnostics.DebuggerDisplayAttribute ("ProjectChooseElement (#Children={Count} "
|
||||
+ "HasOtherwise={OtherwiseElement != null})")]
|
||||
public class ProjectChooseElement : ProjectElementContainer
|
||||
{
|
||||
internal ProjectChooseElement (ProjectRootElement containingProject)
|
||||
{
|
||||
ContainingProject = containingProject;
|
||||
}
|
||||
public override string Condition { get { return null; } set { throw new InvalidOperationException(
|
||||
"Can not set Condition."); } }
|
||||
public ProjectOtherwiseElement OtherwiseElement {
|
||||
get { return LastChild as ProjectOtherwiseElement; }
|
||||
}
|
||||
public ICollection<ProjectWhenElement> WhenElements {
|
||||
get { return new CollectionFromEnumerable<ProjectWhenElement> (
|
||||
new FilteredEnumerable<ProjectWhenElement> (Children)); }
|
||||
}
|
||||
internal override string XmlName {
|
||||
get { return "Choose"; }
|
||||
}
|
||||
internal override ProjectElement LoadChildElement (string name)
|
||||
{
|
||||
switch (name) {
|
||||
case "Otherwise":
|
||||
var other = ContainingProject.CreateOtherwiseElement ();
|
||||
AppendChild (other);
|
||||
return other;
|
||||
case "When":
|
||||
var when = ContainingProject.CreateWhenElement (null);
|
||||
PrependChild (when);
|
||||
return when;
|
||||
default:
|
||||
throw new InvalidProjectFileException (string.Format (
|
||||
"Child \"{0}\" is not a known node type.", name));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
//
|
||||
// ProjectCommentElement.cs
|
||||
//
|
||||
// Author:
|
||||
// Leszek Ciesielski ([email protected])
|
||||
//
|
||||
// (C) 2011 Leszek Ciesielski
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Xml;
|
||||
|
||||
namespace Microsoft.Build.Construction
|
||||
{
|
||||
internal class ProjectCommentElement : ProjectElement
|
||||
{
|
||||
internal ProjectCommentElement (ProjectRootElement containingProject)
|
||||
{
|
||||
ContainingProject = containingProject;
|
||||
}
|
||||
|
||||
string comment;
|
||||
public string Comment { get { return comment ?? String.Empty; } set { comment = value; } }
|
||||
|
||||
internal override string XmlName {
|
||||
get { return String.Empty; }
|
||||
}
|
||||
|
||||
internal override void Load (XmlReader reader)
|
||||
{
|
||||
LoadValue (reader);
|
||||
}
|
||||
|
||||
internal override void LoadAttribute (string name, string value)
|
||||
{
|
||||
}
|
||||
|
||||
internal override void LoadValue (XmlReader reader)
|
||||
{
|
||||
if (reader.NodeType == XmlNodeType.Comment) {
|
||||
Comment = reader.Value;
|
||||
}
|
||||
}
|
||||
|
||||
internal override void Save (XmlWriter writer)
|
||||
{
|
||||
this.SaveValue (writer);
|
||||
}
|
||||
|
||||
internal override void SaveValue (XmlWriter writer)
|
||||
{
|
||||
if (!String.IsNullOrEmpty (Comment)) {
|
||||
writer.WriteComment (Comment);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
//
|
||||
// ProjectElement.cs
|
||||
//
|
||||
// Author:
|
||||
// Leszek Ciesielski ([email protected])
|
||||
//
|
||||
// (C) 2011 Leszek Ciesielski
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using Microsoft.Build.Exceptions;
|
||||
|
||||
namespace Microsoft.Build.Construction
|
||||
{
|
||||
public abstract class ProjectElement
|
||||
{
|
||||
internal ProjectElement ()
|
||||
{
|
||||
linkedListNode = new LinkedListNode<ProjectElement> (this);
|
||||
}
|
||||
public ProjectRootElement ContainingProject { get; internal set; }
|
||||
public ProjectElement PreviousSibling {
|
||||
get { return LinkedListNode.Previous == null ? null : LinkedListNode.Previous.Value; }
|
||||
internal set { }
|
||||
}
|
||||
public ProjectElementContainer Parent { get; internal set; }
|
||||
public ProjectElement NextSibling {
|
||||
get { return LinkedListNode.Next == null ? null : LinkedListNode.Next.Value; }
|
||||
internal set { }
|
||||
}
|
||||
string label;
|
||||
public string Label { get { return label ?? String.Empty; } set { label = value; } }
|
||||
string condition;
|
||||
public virtual string Condition { get { return condition ?? String.Empty; } set { condition = value; } }
|
||||
public IEnumerable<ProjectElementContainer> AllParents {
|
||||
get {
|
||||
var parent = Parent;
|
||||
while (parent != null) {
|
||||
yield return parent;
|
||||
parent = parent.Parent;
|
||||
}
|
||||
}
|
||||
}
|
||||
readonly LinkedListNode<ProjectElement> linkedListNode;
|
||||
internal LinkedListNode<ProjectElement> LinkedListNode { get { return linkedListNode; } }
|
||||
internal virtual void Load (XmlReader reader)
|
||||
{
|
||||
reader.ReadToFollowing (XmlName);
|
||||
while (reader.MoveToNextAttribute ()) {
|
||||
LoadAttribute (reader.Name, reader.Value);
|
||||
}
|
||||
LoadValue (reader);
|
||||
}
|
||||
internal virtual void LoadAttribute (string name, string value)
|
||||
{
|
||||
switch (name) {
|
||||
case "xmlns":
|
||||
break;
|
||||
case "Label":
|
||||
Label = value;
|
||||
break;
|
||||
case "Condition":
|
||||
Condition = value;
|
||||
break;
|
||||
default:
|
||||
throw new InvalidProjectFileException (string.Format (
|
||||
"Attribute \"{0}\" is not known on node \"{1}\" [type {2}].", name, XmlName,
|
||||
GetType ()));
|
||||
}
|
||||
}
|
||||
internal virtual void LoadValue (XmlReader reader)
|
||||
{
|
||||
}
|
||||
internal abstract string XmlName { get; }
|
||||
internal virtual void Save (XmlWriter writer)
|
||||
{
|
||||
writer.WriteStartElement (XmlName);
|
||||
SaveValue (writer);
|
||||
writer.WriteEndElement ();
|
||||
}
|
||||
internal virtual void SaveValue (XmlWriter writer)
|
||||
{
|
||||
SaveAttribute (writer, "Label", Label);
|
||||
SaveAttribute (writer, "Condition", Condition);
|
||||
}
|
||||
internal void SaveAttribute (XmlWriter writer, string attributeName, string attributeValue)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace (attributeValue))
|
||||
writer.WriteAttributeString (attributeName, attributeValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
//
|
||||
// ProjectElementContainer.cs
|
||||
//
|
||||
// Author:
|
||||
// Leszek Ciesielski ([email protected])
|
||||
//
|
||||
// (C) 2011 Leszek Ciesielski
|
||||
//
|
||||
// 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.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml;
|
||||
using Microsoft.Build.Internal;
|
||||
|
||||
namespace Microsoft.Build.Construction
|
||||
{
|
||||
public abstract class ProjectElementContainer : ProjectElement
|
||||
{
|
||||
internal ProjectElementContainer () {}
|
||||
LinkedList<ProjectElement> children = new LinkedList<ProjectElement> ();
|
||||
|
||||
public IEnumerable<ProjectElement> AllChildren {
|
||||
get {
|
||||
foreach (var child in Children) {
|
||||
var container = child as ProjectElementContainer;
|
||||
if (container != null)
|
||||
foreach (var containersChild in container.AllChildren)
|
||||
yield return containersChild;
|
||||
yield return child;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ICollection<ProjectElement> Children {
|
||||
get { return new CollectionFromEnumerable<ProjectElement> (
|
||||
children.Where (p => !(p is ProjectCommentElement))); }
|
||||
}
|
||||
|
||||
public ICollection<ProjectElement> ChildrenReversed {
|
||||
get { return new CollectionFromEnumerable<ProjectElement> (
|
||||
new ReverseEnumerable<ProjectElement> (children)); }
|
||||
}
|
||||
|
||||
public int Count {
|
||||
get { return children.Count; }
|
||||
}
|
||||
public ProjectElement FirstChild {
|
||||
get { return children.First == null ? null : children.First.Value; }
|
||||
private set { }
|
||||
}
|
||||
public ProjectElement LastChild {
|
||||
get { return children.Last == null ? null: children.Last.Value; }
|
||||
private set { }
|
||||
}
|
||||
|
||||
public void AppendChild (ProjectElement child)
|
||||
{
|
||||
children.AddLast (child.LinkedListNode);
|
||||
child.Parent = this;
|
||||
}
|
||||
|
||||
public void InsertAfterChild (ProjectElement child, ProjectElement reference)
|
||||
{
|
||||
if (reference == null) {
|
||||
PrependChild (child);
|
||||
} else {
|
||||
child.Parent = this;
|
||||
children.AddAfter (reference.LinkedListNode, child.LinkedListNode);
|
||||
}
|
||||
}
|
||||
|
||||
public void InsertBeforeChild (ProjectElement child, ProjectElement reference)
|
||||
{
|
||||
if (reference == null) {
|
||||
AppendChild (child);
|
||||
} else {
|
||||
child.Parent = this;
|
||||
children.AddBefore (reference.LinkedListNode, child.LinkedListNode);
|
||||
}
|
||||
}
|
||||
|
||||
public void PrependChild (ProjectElement child)
|
||||
{
|
||||
children.AddFirst (child.LinkedListNode);
|
||||
child.Parent = this;
|
||||
}
|
||||
|
||||
public void RemoveAllChildren ()
|
||||
{
|
||||
foreach (var child in children)
|
||||
RemoveChild (child);
|
||||
}
|
||||
|
||||
public void RemoveChild (ProjectElement child)
|
||||
{
|
||||
child.Parent = null;
|
||||
children.Remove (child.LinkedListNode);
|
||||
}
|
||||
|
||||
internal override void SaveValue (XmlWriter writer)
|
||||
{
|
||||
base.SaveValue (writer);
|
||||
foreach (var child in children)
|
||||
child.Save (writer);
|
||||
}
|
||||
|
||||
internal override void LoadValue (XmlReader reader)
|
||||
{
|
||||
while (reader.Read ()) {
|
||||
if (reader.NodeType == XmlNodeType.Element) {
|
||||
var child = LoadChildElement (reader.Name);
|
||||
child.Load (reader.ReadSubtree ());
|
||||
} else if (reader.NodeType == XmlNodeType.Comment) {
|
||||
var commentElement = new ProjectCommentElement (ContainingProject);
|
||||
commentElement.Load (reader);
|
||||
AppendChild (commentElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal abstract ProjectElement LoadChildElement (string name);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
//
|
||||
// ProjectExtensionsElement.cs
|
||||
//
|
||||
// Author:
|
||||
// Leszek Ciesielski ([email protected])
|
||||
//
|
||||
// (C) 2011 Leszek Ciesielski
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Xml;
|
||||
using System.Text;
|
||||
|
||||
namespace Microsoft.Build.Construction
|
||||
{
|
||||
public class ProjectExtensionsElement : ProjectElement
|
||||
{
|
||||
internal ProjectExtensionsElement (ProjectRootElement containingProject)
|
||||
{
|
||||
ContainingProject = containingProject;
|
||||
}
|
||||
public override string Condition {
|
||||
get { return null; }
|
||||
set {
|
||||
throw new InvalidOperationException ("Can not set Condition.");
|
||||
}
|
||||
}
|
||||
public string Content {
|
||||
get { return element.InnerXml; }
|
||||
set { element.InnerXml = value; }
|
||||
}
|
||||
public string this[string name] {
|
||||
get {
|
||||
var child = element[name];
|
||||
return child == null ? string.Empty : child.InnerXml;
|
||||
}
|
||||
set {
|
||||
var child = element[name];
|
||||
if (child == null) {
|
||||
if (string.IsNullOrEmpty (name))
|
||||
return;
|
||||
child = document.CreateElement (name);
|
||||
element.AppendChild (child);
|
||||
}
|
||||
if (string.IsNullOrEmpty (value))
|
||||
element.RemoveChild (child);
|
||||
else
|
||||
child.InnerXml = value;
|
||||
}
|
||||
}
|
||||
internal override void Load (XmlReader reader)
|
||||
{
|
||||
while (reader.Read () && reader.NodeType != XmlNodeType.Element)
|
||||
;
|
||||
using (XmlReader subReader = reader.ReadSubtree ()) {
|
||||
document = new XmlDocument ();
|
||||
document.Load (subReader);
|
||||
element = document.DocumentElement;
|
||||
}
|
||||
}
|
||||
internal override void SaveValue (XmlWriter writer)
|
||||
{
|
||||
element.WriteContentTo (writer);
|
||||
}
|
||||
internal override string XmlName {
|
||||
get { return "ProjectExtensions"; }
|
||||
}
|
||||
XmlDocument document;
|
||||
XmlElement element;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// ProjectImportElement.cs
|
||||
//
|
||||
// Author:
|
||||
// Leszek Ciesielski ([email protected])
|
||||
//
|
||||
// (C) 2011 Leszek Ciesielski
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Xml;
|
||||
namespace Microsoft.Build.Construction
|
||||
{
|
||||
[System.Diagnostics.DebuggerDisplayAttribute ("Project={Project} Condition={Condition}")]
|
||||
public class ProjectImportElement : ProjectElement
|
||||
{
|
||||
internal ProjectImportElement (string project, ProjectRootElement containingProject)
|
||||
: this(containingProject)
|
||||
{
|
||||
Project = project;
|
||||
}
|
||||
|
||||
internal ProjectImportElement (ProjectRootElement containingProject)
|
||||
{
|
||||
ContainingProject = containingProject;
|
||||
}
|
||||
|
||||
string project;
|
||||
public string Project { get { return project ?? String.Empty; } set { project = value; } }
|
||||
|
||||
internal override string XmlName {
|
||||
get { return "Import"; }
|
||||
}
|
||||
|
||||
internal override void SaveValue (XmlWriter writer)
|
||||
{
|
||||
SaveAttribute (writer, "Project", Project);
|
||||
base.SaveValue (writer);
|
||||
}
|
||||
|
||||
internal override void LoadAttribute (string name, string value)
|
||||
{
|
||||
switch (name) {
|
||||
case "Project":
|
||||
Project = value;
|
||||
break;
|
||||
default:
|
||||
base.LoadAttribute (name, value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
//
|
||||
// ProjectImportGroupElement.cs
|
||||
//
|
||||
// Author:
|
||||
// Leszek Ciesielski ([email protected])
|
||||
//
|
||||
// (C) 2011 Leszek Ciesielski
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Build.Internal;
|
||||
|
||||
namespace Microsoft.Build.Construction
|
||||
{
|
||||
[System.Diagnostics.DebuggerDisplayAttribute ("#Imports={Count} Condition={Condition} Label={Label}")]
|
||||
public class ProjectImportGroupElement : ProjectElementContainer
|
||||
{
|
||||
internal ProjectImportGroupElement (ProjectRootElement containingProject)
|
||||
{
|
||||
ContainingProject = containingProject;
|
||||
}
|
||||
public ICollection<ProjectImportElement> Imports {
|
||||
get { return new CollectionFromEnumerable<ProjectImportElement> (
|
||||
new FilteredEnumerable<ProjectImportElement> (Children)); }
|
||||
}
|
||||
public ProjectImportElement AddImport (string project)
|
||||
{
|
||||
var import = ContainingProject.CreateImportElement (project);
|
||||
AppendChild (import);
|
||||
return import;
|
||||
}
|
||||
internal override string XmlName { get { return "ImportGroup"; } }
|
||||
internal override ProjectElement LoadChildElement (string name)
|
||||
{
|
||||
return AddImport (null);
|
||||
}
|
||||
}
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// ProjectItemDefinitionElement.cs
|
||||
//
|
||||
// Author:
|
||||
// Leszek Ciesielski ([email protected])
|
||||
//
|
||||
// (C) 2011 Leszek Ciesielski
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Build.Internal;
|
||||
|
||||
namespace Microsoft.Build.Construction
|
||||
{
|
||||
[System.Diagnostics.DebuggerDisplayAttribute ("{ItemType} #Metadata={Count} Condition={Condition}")]
|
||||
public class ProjectItemDefinitionElement : ProjectElementContainer
|
||||
{
|
||||
internal ProjectItemDefinitionElement (string itemType, ProjectRootElement containingProject)
|
||||
{
|
||||
ItemType = itemType;
|
||||
ContainingProject = containingProject;
|
||||
}
|
||||
public string ItemType { get; private set; }
|
||||
public ICollection<ProjectMetadataElement> Metadata {
|
||||
get { return new CollectionFromEnumerable<ProjectMetadataElement> (
|
||||
new FilteredEnumerable<ProjectMetadataElement> (Children)); }
|
||||
}
|
||||
public ProjectMetadataElement AddMetadata (string name, string unevaluatedValue)
|
||||
{
|
||||
var metadata = ContainingProject.CreateMetadataElement (name);
|
||||
metadata.Value = unevaluatedValue;
|
||||
AppendChild (metadata);
|
||||
return metadata;
|
||||
}
|
||||
internal override string XmlName {
|
||||
get { return ItemType; }
|
||||
}
|
||||
internal override ProjectElement LoadChildElement (string name)
|
||||
{
|
||||
return AddMetadata (name, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// ProjectItemDefinitionGroupElement.cs
|
||||
//
|
||||
// Author:
|
||||
// Leszek Ciesielski ([email protected])
|
||||
//
|
||||
// (C) 2011 Leszek Ciesielski
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Build.Internal;
|
||||
|
||||
namespace Microsoft.Build.Construction
|
||||
{
|
||||
[System.Diagnostics.DebuggerDisplayAttribute ("#ItemDefinitions={Count} Condition={Condition} Label={Label}")]
|
||||
public class ProjectItemDefinitionGroupElement : ProjectElementContainer
|
||||
{
|
||||
internal ProjectItemDefinitionGroupElement (ProjectRootElement containingProject)
|
||||
{
|
||||
ContainingProject = containingProject;
|
||||
}
|
||||
public ICollection<ProjectItemDefinitionElement> ItemDefinitions {
|
||||
get { return new CollectionFromEnumerable<ProjectItemDefinitionElement> (
|
||||
new FilteredEnumerable<ProjectItemDefinitionElement> (Children)); }
|
||||
}
|
||||
public ProjectItemDefinitionElement AddItemDefinition (string itemType)
|
||||
{
|
||||
var definition = ContainingProject.CreateItemDefinitionElement (itemType);
|
||||
AppendChild (definition);
|
||||
return definition;
|
||||
}
|
||||
internal override string XmlName {
|
||||
get { return "ItemDefinitionGroup"; }
|
||||
}
|
||||
internal override ProjectElement LoadChildElement (string name)
|
||||
{
|
||||
return AddItemDefinition (name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
//
|
||||
// ProjectItemElementa.cs
|
||||
//
|
||||
// Author:
|
||||
// Leszek Ciesielski ([email protected])
|
||||
//
|
||||
// (C) 2011 Leszek Ciesielski
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Build.Internal;
|
||||
using System.Xml;
|
||||
|
||||
namespace Microsoft.Build.Construction
|
||||
{
|
||||
[System.Diagnostics.DebuggerDisplayAttribute ("{ItemType} Include={Include} Exclude={Exclude} "
|
||||
+ "#Metadata={Count} Condition={Condition}")]
|
||||
public class ProjectItemElement : ProjectElementContainer
|
||||
{
|
||||
internal ProjectItemElement (string itemType, ProjectRootElement containingProject)
|
||||
{
|
||||
ItemType = itemType;
|
||||
ContainingProject = containingProject;
|
||||
}
|
||||
string exclude;
|
||||
public string Exclude { get { return exclude ?? String.Empty; } set { exclude = value; } }
|
||||
public bool HasMetadata {
|
||||
get {
|
||||
var metadata = Metadata.FirstOrDefault ();
|
||||
return metadata != null;
|
||||
}
|
||||
}
|
||||
string include;
|
||||
public string Include { get { return include ?? String.Empty; } set { include = value; } }
|
||||
string itemType;
|
||||
public string ItemType { get { return itemType ?? String.Empty; } set { itemType = value; } }
|
||||
public ICollection<ProjectMetadataElement> Metadata {
|
||||
get { return new CollectionFromEnumerable<ProjectMetadataElement> (
|
||||
new FilteredEnumerable<ProjectMetadataElement> (Children)); }
|
||||
}
|
||||
string @remove;
|
||||
public string Remove { get { return @remove ?? String.Empty; } set { @remove = value; } }
|
||||
public ProjectMetadataElement AddMetadata (string name, string unevaluatedValue)
|
||||
{
|
||||
var metadata = ContainingProject.CreateMetadataElement (name, unevaluatedValue);
|
||||
AppendChild (metadata);
|
||||
return metadata;
|
||||
}
|
||||
internal override string XmlName {
|
||||
get { return ItemType; }
|
||||
}
|
||||
internal override void SaveValue (XmlWriter writer)
|
||||
{
|
||||
SaveAttribute (writer, "Include", Include);
|
||||
SaveAttribute (writer, "Exclude", Exclude);
|
||||
SaveAttribute (writer, "Remove", Remove);
|
||||
base.SaveValue (writer);
|
||||
}
|
||||
internal override void LoadAttribute (string name, string value)
|
||||
{
|
||||
switch (name) {
|
||||
case "Include":
|
||||
Include = value;
|
||||
break;
|
||||
case "Exclude":
|
||||
Exclude = value;
|
||||
break;
|
||||
case "Remove":
|
||||
Remove = value;
|
||||
break;
|
||||
default:
|
||||
base.LoadAttribute (name, value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
internal override ProjectElement LoadChildElement (string name)
|
||||
{
|
||||
var metadata = ContainingProject.CreateMetadataElement (name);
|
||||
AppendChild (metadata);
|
||||
return metadata;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
//
|
||||
// ProjectItemGroupElement.cs
|
||||
//
|
||||
// Author:
|
||||
// Leszek Ciesielski ([email protected])
|
||||
//
|
||||
// (C) 2011 Leszek Ciesielski
|
||||
//
|
||||
// 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.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Build.Internal;
|
||||
using System;
|
||||
|
||||
namespace Microsoft.Build.Construction
|
||||
{
|
||||
[System.Diagnostics.DebuggerDisplayAttribute ("#Items={Count} Condition={Condition} Label={Label}")]
|
||||
public class ProjectItemGroupElement : ProjectElementContainer
|
||||
{
|
||||
public ProjectItemElement AddItem (string itemType, string include)
|
||||
{
|
||||
return AddItem (itemType, include, null);
|
||||
}
|
||||
|
||||
public ProjectItemElement AddItem (string itemType, string include,
|
||||
IEnumerable<KeyValuePair<string, string>> metadata)
|
||||
{
|
||||
var item = ContainingProject.CreateItemElement (itemType, include);
|
||||
if (metadata != null)
|
||||
foreach (var data in metadata)
|
||||
item.AddMetadata (data.Key, data.Value);
|
||||
var lastChild = LastChild;
|
||||
foreach (var existingItem in Items) {
|
||||
var compare = string.Compare (item.ItemType, existingItem.ItemType,
|
||||
StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
if (compare == 0) {
|
||||
if (string.Compare (item.Include, existingItem.Include,
|
||||
StringComparison.OrdinalIgnoreCase) >= 0)
|
||||
continue;
|
||||
lastChild = existingItem.PreviousSibling;
|
||||
break;
|
||||
}
|
||||
|
||||
if (compare < 0) {
|
||||
lastChild = existingItem.PreviousSibling;
|
||||
break;
|
||||
}
|
||||
}
|
||||
InsertAfterChild (item, lastChild);
|
||||
return item;
|
||||
}
|
||||
|
||||
internal ProjectItemGroupElement (ProjectRootElement containingProject)
|
||||
{
|
||||
ContainingProject = containingProject;
|
||||
}
|
||||
|
||||
public ICollection<ProjectItemElement> Items {
|
||||
get { return new CollectionFromEnumerable<ProjectItemElement> (
|
||||
new FilteredEnumerable<ProjectItemElement> (Children)); }
|
||||
}
|
||||
|
||||
internal override string XmlName {
|
||||
get { return "ItemGroup"; }
|
||||
}
|
||||
|
||||
internal override ProjectElement LoadChildElement (string name)
|
||||
{
|
||||
var item = ContainingProject.CreateItemElement (name);
|
||||
AppendChild (item);
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// ProjectMetadataElement.cs
|
||||
//
|
||||
// Author:
|
||||
// Leszek Ciesielski ([email protected])
|
||||
//
|
||||
// (C) 2011 Leszek Ciesielski
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
|
||||
namespace Microsoft.Build.Construction
|
||||
{
|
||||
[System.Diagnostics.DebuggerDisplayAttribute ("{Name} Value={Value} Condition={Condition}")]
|
||||
public class ProjectMetadataElement : ProjectElement
|
||||
{
|
||||
internal ProjectMetadataElement (string name, ProjectRootElement containingProject)
|
||||
{
|
||||
Name = name;
|
||||
ContainingProject = containingProject;
|
||||
}
|
||||
string name;
|
||||
public string Name { get { return name ?? String.Empty; } set { name = value; } }
|
||||
string internalValue;
|
||||
public string Value { get { return internalValue ?? String.Empty; } set { internalValue = value; } }
|
||||
internal override string XmlName {
|
||||
get { return Name; }
|
||||
}
|
||||
internal override void SaveValue (XmlWriter writer)
|
||||
{
|
||||
base.SaveValue (writer);
|
||||
if (!string.IsNullOrWhiteSpace (Value))
|
||||
writer.WriteValue (Value);
|
||||
}
|
||||
internal override void LoadValue (XmlReader reader)
|
||||
{
|
||||
while (reader.Read () & reader.NodeType != XmlNodeType.Text)
|
||||
;
|
||||
Value = reader.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// ProjectOnErrorElement.cs
|
||||
//
|
||||
// Author:
|
||||
// Leszek Ciesielski ([email protected])
|
||||
//
|
||||
// (C) 2011 Leszek Ciesielski
|
||||
//
|
||||
// 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.Xml;
|
||||
namespace Microsoft.Build.Construction
|
||||
{
|
||||
[System.Diagnostics.DebuggerDisplayAttribute ("ExecuteTargets={ExecuteTargets}")]
|
||||
public class ProjectOnErrorElement : ProjectElement
|
||||
{
|
||||
internal ProjectOnErrorElement (string executeTargets, ProjectRootElement containingProject)
|
||||
: this(containingProject)
|
||||
{
|
||||
ExecuteTargetsAttribute = executeTargets;
|
||||
}
|
||||
internal ProjectOnErrorElement (ProjectRootElement containingProject)
|
||||
{
|
||||
ContainingProject = containingProject;
|
||||
}
|
||||
public string ExecuteTargetsAttribute { get; set; }
|
||||
internal override string XmlName {
|
||||
get { return "OnError"; }
|
||||
}
|
||||
internal override void SaveValue (XmlWriter writer)
|
||||
{
|
||||
base.SaveValue (writer);
|
||||
SaveAttribute (writer, "ExecuteTargets", ExecuteTargetsAttribute);
|
||||
}
|
||||
internal override void LoadAttribute (string name, string value)
|
||||
{
|
||||
switch (name) {
|
||||
case "ExecuteTargets":
|
||||
ExecuteTargetsAttribute = value;
|
||||
break;
|
||||
default:
|
||||
base.LoadAttribute (name, value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
//
|
||||
// ProjectOtherwiseElement.cs
|
||||
//
|
||||
// Author:
|
||||
// Leszek Ciesielski ([email protected])
|
||||
//
|
||||
// (C) 2011 Leszek Ciesielski
|
||||
//
|
||||
// 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.Collections.Generic;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Microsoft.Build.Exceptions;
|
||||
using Microsoft.Build.Internal;
|
||||
|
||||
namespace Microsoft.Build.Construction
|
||||
{
|
||||
[System.Diagnostics.DebuggerDisplayAttribute ("#Children={Count}")]
|
||||
public class ProjectOtherwiseElement : ProjectElementContainer
|
||||
{
|
||||
internal ProjectOtherwiseElement (ProjectRootElement containingProject)
|
||||
{
|
||||
ContainingProject = containingProject;
|
||||
}
|
||||
public ICollection<ProjectChooseElement> ChooseElements {
|
||||
get { return new CollectionFromEnumerable<ProjectChooseElement> (
|
||||
new FilteredEnumerable<ProjectChooseElement> (Children)); }
|
||||
}
|
||||
public override string Condition {
|
||||
get { return null; }
|
||||
set {
|
||||
throw new InvalidOperationException ("Can not set Condition.");
|
||||
}
|
||||
}
|
||||
public ICollection<ProjectItemGroupElement> ItemGroups {
|
||||
get { return new CollectionFromEnumerable<ProjectItemGroupElement> (
|
||||
new FilteredEnumerable<ProjectItemGroupElement> (Children)); }
|
||||
}
|
||||
public ICollection<ProjectPropertyGroupElement> PropertyGroups {
|
||||
get { return new CollectionFromEnumerable<ProjectPropertyGroupElement> (
|
||||
new FilteredEnumerable<ProjectPropertyGroupElement> (Children)); }
|
||||
}
|
||||
internal override string XmlName {
|
||||
get { return "Otherwise"; }
|
||||
}
|
||||
internal override ProjectElement LoadChildElement (string name)
|
||||
{
|
||||
switch (name) {
|
||||
case "PropertyGroup":
|
||||
var property = ContainingProject.CreatePropertyGroupElement ();
|
||||
AppendChild (property);
|
||||
return property;
|
||||
case "ItemGroup":
|
||||
var item = ContainingProject.CreateItemGroupElement ();
|
||||
AppendChild (item);
|
||||
return item;
|
||||
case "When":
|
||||
var when = ContainingProject.CreateWhenElement (null);
|
||||
AppendChild (when);
|
||||
return when;
|
||||
default:
|
||||
throw new InvalidProjectFileException (string.Format (
|
||||
"Child \"{0}\" is not a known node type.", name));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
//
|
||||
// ProjectOutputElement.cs
|
||||
//
|
||||
// Author:
|
||||
// Leszek Ciesielski ([email protected])
|
||||
//
|
||||
// (C) 2011 Leszek Ciesielski
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Xml;
|
||||
namespace Microsoft.Build.Construction
|
||||
{
|
||||
[System.Diagnostics.DebuggerDisplayAttribute ("Name={Name} TaskParameter={TaskParameter} ItemName={ItemName} "
|
||||
+ "PropertyName={PropertyName} Condition={Condition}")]
|
||||
public class ProjectOutputElement : ProjectElement
|
||||
{
|
||||
internal ProjectOutputElement (string taskParameter, string itemType, string propertyName,
|
||||
ProjectRootElement containintProject)
|
||||
{
|
||||
TaskParameter = taskParameter;
|
||||
ItemType = itemType;
|
||||
PropertyName = propertyName;
|
||||
ContainingProject = containintProject;
|
||||
}
|
||||
public bool IsOutputItem {
|
||||
get { return !String.IsNullOrWhiteSpace(itemType); }
|
||||
}
|
||||
public bool IsOutputProperty {
|
||||
get { return !String.IsNullOrWhiteSpace(propertyName); }
|
||||
}
|
||||
string itemType;
|
||||
public string ItemType { get { return itemType ?? String.Empty; } set { itemType = value; } }
|
||||
string propertyName;
|
||||
public string PropertyName { get { return propertyName ?? String.Empty; } set { propertyName = value; } }
|
||||
string taskParameter;
|
||||
public string TaskParameter {
|
||||
get { return taskParameter ?? String.Empty; }
|
||||
set { taskParameter = value; }
|
||||
}
|
||||
internal override string XmlName {
|
||||
get { return "Output"; }
|
||||
}
|
||||
internal override void SaveValue (XmlWriter writer)
|
||||
{
|
||||
base.SaveValue (writer);
|
||||
SaveAttribute (writer, "TaskParameter", TaskParameter);
|
||||
if (IsOutputProperty)
|
||||
SaveAttribute (writer, "PropertyName", PropertyName);
|
||||
else
|
||||
SaveAttribute (writer, "ItemName", ItemType);
|
||||
}
|
||||
internal override void LoadAttribute (string name, string value)
|
||||
{
|
||||
switch (name) {
|
||||
case "TaskParameter":
|
||||
TaskParameter = value;
|
||||
break;
|
||||
case "PropertyName":
|
||||
PropertyName = value;
|
||||
break;
|
||||
case "ItemName":
|
||||
ItemType = value;
|
||||
break;
|
||||
default:
|
||||
base.LoadAttribute (name, value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// ProjectPropertyElement.cs
|
||||
//
|
||||
// Author:
|
||||
// Leszek Ciesielski ([email protected])
|
||||
//
|
||||
// (C) 2011 Leszek Ciesielski
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Xml;
|
||||
namespace Microsoft.Build.Construction
|
||||
{
|
||||
[System.Diagnostics.DebuggerDisplayAttribute ("{Name} Value={Value} Condition={Condition}")]
|
||||
public class ProjectPropertyElement : ProjectElement
|
||||
{
|
||||
string name;
|
||||
public string Name { get { return name ?? String.Empty; } set { name = value; } }
|
||||
string internalValue;
|
||||
public string Value { get { return internalValue ?? String.Empty; } set { internalValue = value; } }
|
||||
internal ProjectPropertyElement (string name, ProjectRootElement containingProject)
|
||||
{
|
||||
Name = name;
|
||||
ContainingProject = containingProject;
|
||||
}
|
||||
internal override string XmlName {
|
||||
get { return Name; }
|
||||
}
|
||||
internal override void SaveValue (XmlWriter writer)
|
||||
{
|
||||
base.SaveValue (writer);
|
||||
if (!string.IsNullOrWhiteSpace (Value))
|
||||
writer.WriteValue (Value);
|
||||
}
|
||||
internal override void LoadValue (XmlReader reader)
|
||||
{
|
||||
while (reader.Read () & reader.NodeType != XmlNodeType.Text)
|
||||
;
|
||||
Value = reader.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// ProjectPropertyGroupElement.cs
|
||||
//
|
||||
// Author:
|
||||
// Leszek Ciesielski ([email protected])
|
||||
//
|
||||
// (C) 2011 Leszek Ciesielski
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Build.Internal;
|
||||
using System.Xml;
|
||||
|
||||
namespace Microsoft.Build.Construction
|
||||
{
|
||||
[System.Diagnostics.DebuggerDisplayAttribute ("#Properties={Count} Condition={Condition} Label={Label}")]
|
||||
public class ProjectPropertyGroupElement : ProjectElementContainer
|
||||
{
|
||||
public ProjectPropertyElement AddProperty (string name, string unevaluatedValue)
|
||||
{
|
||||
var property = ContainingProject.CreatePropertyElement (name);
|
||||
property.Value = unevaluatedValue;
|
||||
AppendChild (property);
|
||||
return property;
|
||||
}
|
||||
|
||||
public ProjectPropertyElement SetProperty (string name, string unevaluatedValue)
|
||||
{
|
||||
var existing = Properties.Where (p => p.Name.Equals (name, StringComparison.OrdinalIgnoreCase)
|
||||
&& p.Condition.Length == 0).FirstOrDefault ();
|
||||
if (existing != null) {
|
||||
existing.Value = unevaluatedValue;
|
||||
return existing;
|
||||
}
|
||||
|
||||
return AddProperty (name, unevaluatedValue);
|
||||
}
|
||||
|
||||
internal ProjectPropertyGroupElement (ProjectRootElement containingProject)
|
||||
{
|
||||
ContainingProject = containingProject;
|
||||
}
|
||||
|
||||
public ICollection<ProjectPropertyElement> Properties {
|
||||
get { return new CollectionFromEnumerable<ProjectPropertyElement> (
|
||||
new FilteredEnumerable<ProjectPropertyElement> (Children)); }
|
||||
}
|
||||
|
||||
public ICollection<ProjectPropertyElement> PropertiesReversed {
|
||||
get { return new CollectionFromEnumerable<ProjectPropertyElement> (
|
||||
new FilteredEnumerable<ProjectPropertyElement> (ChildrenReversed)); }
|
||||
}
|
||||
|
||||
internal override string XmlName {
|
||||
get { return "PropertyGroup"; }
|
||||
}
|
||||
|
||||
internal override ProjectElement LoadChildElement (string name)
|
||||
{
|
||||
return AddProperty (name, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,593 @@
|
||||
//
|
||||
// ProjectRootElement.cs
|
||||
//
|
||||
// Author:
|
||||
// Leszek Ciesielski ([email protected])
|
||||
//
|
||||
// (C) 2011 Leszek Ciesielski
|
||||
//
|
||||
// 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.Collections.Generic;
|
||||
|
||||
using Microsoft.Build.Evaluation;
|
||||
using Microsoft.Build.Internal;
|
||||
using System.Text;
|
||||
using System;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Globalization;
|
||||
using Microsoft.Build.Exceptions;
|
||||
|
||||
namespace Microsoft.Build.Construction
|
||||
{
|
||||
[System.Diagnostics.DebuggerDisplayAttribute("{FullPath} #Children={Count} DefaultTargets={DefaultTargets} "
|
||||
+ "ToolsVersion={ToolsVersion} InitialTargets={InitialTargets}")]
|
||||
public class ProjectRootElement : ProjectElementContainer
|
||||
{
|
||||
public override string Condition { get { return null; } set { throw new InvalidOperationException (
|
||||
"Can not set Condition."); } }
|
||||
string defaultTargets;
|
||||
public string DefaultTargets {
|
||||
get { return defaultTargets ?? String.Empty; }
|
||||
set { defaultTargets = value; }
|
||||
}
|
||||
|
||||
string fullPath;
|
||||
public string FullPath {
|
||||
get { return fullPath; }
|
||||
set {
|
||||
fullPath = Path.GetFullPath (value);
|
||||
DirectoryPath = Path.GetDirectoryName (fullPath);
|
||||
}
|
||||
}
|
||||
|
||||
string directoryPath;
|
||||
public string DirectoryPath {
|
||||
get { return directoryPath ?? String.Empty; }
|
||||
internal set { directoryPath = value; }
|
||||
}
|
||||
|
||||
public ICollection<ProjectPropertyElement> Properties {
|
||||
get { return new CollectionFromEnumerable<ProjectPropertyElement> (
|
||||
new FilteredEnumerable<ProjectPropertyElement> (AllChildren)); }
|
||||
}
|
||||
|
||||
public ICollection<ProjectChooseElement> ChooseElements {
|
||||
get { return new CollectionFromEnumerable<ProjectChooseElement> (
|
||||
new FilteredEnumerable<ProjectChooseElement> (Children)); }
|
||||
}
|
||||
|
||||
public Encoding Encoding {
|
||||
get { return Encoding.UTF8; }
|
||||
}
|
||||
|
||||
public bool HasUnsavedChanges {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public ICollection<ProjectImportGroupElement> ImportGroups {
|
||||
get { return new CollectionFromEnumerable<ProjectImportGroupElement> (
|
||||
new FilteredEnumerable<ProjectImportGroupElement> (Children)); }
|
||||
}
|
||||
|
||||
public ICollection<ProjectImportGroupElement> ImportGroupsReversed {
|
||||
get { return new CollectionFromEnumerable<ProjectImportGroupElement> (
|
||||
new FilteredEnumerable<ProjectImportGroupElement> (ChildrenReversed)); }
|
||||
}
|
||||
|
||||
public ICollection<ProjectImportElement> Imports {
|
||||
get { return new CollectionFromEnumerable<ProjectImportElement> (
|
||||
new FilteredEnumerable<ProjectImportElement> (AllChildren)); }
|
||||
}
|
||||
|
||||
string initialTargets;
|
||||
public string InitialTargets {
|
||||
get { return initialTargets ?? String.Empty; }
|
||||
set { initialTargets = value; }
|
||||
}
|
||||
|
||||
public ICollection<ProjectItemDefinitionGroupElement> ItemDefinitionGroups {
|
||||
get { return new CollectionFromEnumerable<ProjectItemDefinitionGroupElement> (
|
||||
new FilteredEnumerable<ProjectItemDefinitionGroupElement> (Children)); }
|
||||
}
|
||||
|
||||
public ICollection<ProjectItemDefinitionGroupElement> ItemDefinitionGroupsReversed {
|
||||
get { return new CollectionFromEnumerable<ProjectItemDefinitionGroupElement> (
|
||||
new FilteredEnumerable<ProjectItemDefinitionGroupElement> (ChildrenReversed)); }
|
||||
}
|
||||
|
||||
public ICollection<ProjectItemDefinitionElement> ItemDefinitions {
|
||||
get { return new CollectionFromEnumerable<ProjectItemDefinitionElement> (
|
||||
new FilteredEnumerable<ProjectItemDefinitionElement> (AllChildren)); }
|
||||
}
|
||||
|
||||
public ICollection<ProjectItemGroupElement> ItemGroups {
|
||||
get { return new CollectionFromEnumerable<ProjectItemGroupElement> (
|
||||
new FilteredEnumerable<ProjectItemGroupElement> (Children)); }
|
||||
}
|
||||
|
||||
public ICollection<ProjectItemGroupElement> ItemGroupsReversed {
|
||||
get { return new CollectionFromEnumerable<ProjectItemGroupElement> (
|
||||
new FilteredEnumerable<ProjectItemGroupElement> (ChildrenReversed)); }
|
||||
}
|
||||
|
||||
public ICollection<ProjectItemElement> Items {
|
||||
get { return new CollectionFromEnumerable<ProjectItemElement> (
|
||||
new FilteredEnumerable<ProjectItemElement> (AllChildren)); }
|
||||
}
|
||||
|
||||
public DateTime LastWriteTimeWhenRead {
|
||||
get { return DateTime.MinValue; }
|
||||
}
|
||||
|
||||
public ICollection<ProjectPropertyGroupElement> PropertyGroups {
|
||||
get { return new CollectionFromEnumerable<ProjectPropertyGroupElement> (
|
||||
new FilteredEnumerable<ProjectPropertyGroupElement> (Children)); }
|
||||
}
|
||||
|
||||
public ICollection<ProjectPropertyGroupElement> PropertyGroupsReversed {
|
||||
get { return new CollectionFromEnumerable<ProjectPropertyGroupElement> (
|
||||
new FilteredEnumerable<ProjectPropertyGroupElement> (ChildrenReversed)); }
|
||||
}
|
||||
|
||||
public string RawXml {
|
||||
get {
|
||||
using (var writer = new StringWriter (CultureInfo.InvariantCulture)) {
|
||||
Save (writer);
|
||||
return writer.ToString ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ICollection<ProjectTargetElement> Targets {
|
||||
get { return new CollectionFromEnumerable<ProjectTargetElement> (
|
||||
new FilteredEnumerable<ProjectTargetElement> (Children)); }
|
||||
}
|
||||
|
||||
public DateTime TimeLastChanged {
|
||||
get { return DateTime.Now; }
|
||||
}
|
||||
|
||||
string toolsVersion;
|
||||
public string ToolsVersion {
|
||||
get { return toolsVersion ?? "4.0"; }
|
||||
set { toolsVersion = value; }
|
||||
}
|
||||
|
||||
public ICollection<ProjectUsingTaskElement> UsingTasks {
|
||||
get { return new CollectionFromEnumerable<ProjectUsingTaskElement> (
|
||||
new FilteredEnumerable<ProjectUsingTaskElement> (Children)); }
|
||||
}
|
||||
|
||||
public int Version {
|
||||
get { return 0; }
|
||||
}
|
||||
|
||||
ProjectRootElement (ProjectCollection projectCollection)
|
||||
{
|
||||
}
|
||||
|
||||
public static ProjectRootElement Create ()
|
||||
{
|
||||
return Create (ProjectCollection.GlobalProjectCollection);
|
||||
}
|
||||
|
||||
public static ProjectRootElement Create (ProjectCollection projectCollection)
|
||||
{
|
||||
return new ProjectRootElement (projectCollection);
|
||||
}
|
||||
|
||||
public static ProjectRootElement Create (string path)
|
||||
{
|
||||
return Create (path, ProjectCollection.GlobalProjectCollection);
|
||||
}
|
||||
|
||||
public static ProjectRootElement Create (XmlReader xmlReader)
|
||||
{
|
||||
return Create (xmlReader, ProjectCollection.GlobalProjectCollection);
|
||||
}
|
||||
|
||||
public static ProjectRootElement Create (string path, ProjectCollection projectCollection)
|
||||
{
|
||||
var result = Create (projectCollection);
|
||||
result.FullPath = path;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static ProjectRootElement Create (XmlReader xmlReader, ProjectCollection projectCollection)
|
||||
{
|
||||
// yes, this should create en empty project
|
||||
var result = Create (projectCollection);
|
||||
return result;
|
||||
}
|
||||
|
||||
public ProjectImportElement AddImport (string project)
|
||||
{
|
||||
var import = CreateImportElement (project);
|
||||
AppendChild (import);
|
||||
return import;
|
||||
}
|
||||
|
||||
public ProjectImportGroupElement AddImportGroup ()
|
||||
{
|
||||
var importGroup = CreateImportGroupElement ();
|
||||
AppendChild (importGroup);
|
||||
return importGroup;
|
||||
}
|
||||
|
||||
public ProjectItemElement AddItem (string itemType, string include)
|
||||
{
|
||||
return AddItem (itemType, include, null);
|
||||
}
|
||||
|
||||
public ProjectItemElement AddItem (string itemType, string include,
|
||||
IEnumerable<KeyValuePair<string, string>> metadata)
|
||||
{
|
||||
var @group = ItemGroups.
|
||||
Where (p => string.IsNullOrEmpty (p.Condition)
|
||||
&& p.Items.Where (s => s.ItemType.Equals (itemType,
|
||||
StringComparison.OrdinalIgnoreCase)).FirstOrDefault () != null).
|
||||
FirstOrDefault ();
|
||||
if (@group == null)
|
||||
@group = AddItemGroup ();
|
||||
return @group.AddItem (itemType, include, metadata);
|
||||
}
|
||||
|
||||
public ProjectItemDefinitionElement AddItemDefinition (string itemType)
|
||||
{
|
||||
var @group = ItemDefinitionGroups.
|
||||
Where (p => string.IsNullOrEmpty (p.Condition)
|
||||
&& p.ItemDefinitions.Where (s => s.ItemType.Equals (itemType,
|
||||
StringComparison.OrdinalIgnoreCase)).FirstOrDefault () != null).
|
||||
FirstOrDefault ();
|
||||
if (@group == null)
|
||||
@group = AddItemDefinitionGroup ();
|
||||
return @group.AddItemDefinition (itemType);
|
||||
}
|
||||
|
||||
public ProjectItemDefinitionGroupElement AddItemDefinitionGroup ()
|
||||
{
|
||||
var @group = CreateItemDefinitionGroupElement ();
|
||||
ProjectElementContainer last = ItemDefinitionGroupsReversed.FirstOrDefault ();
|
||||
if (last == null)
|
||||
last = PropertyGroupsReversed.FirstOrDefault ();
|
||||
InsertAfterChild (@group, last);
|
||||
return @group;
|
||||
}
|
||||
|
||||
public ProjectItemGroupElement AddItemGroup ()
|
||||
{
|
||||
var @group = CreateItemGroupElement ();
|
||||
ProjectElementContainer last = ItemGroupsReversed.FirstOrDefault ();
|
||||
if (last == null)
|
||||
last = PropertyGroupsReversed.FirstOrDefault ();
|
||||
InsertAfterChild (@group, last);
|
||||
return @group;
|
||||
}
|
||||
|
||||
public ProjectPropertyElement AddProperty (string name, string value)
|
||||
{
|
||||
ProjectPropertyGroupElement parentGroup = null;
|
||||
foreach (var @group in PropertyGroups) {
|
||||
if (string.IsNullOrEmpty (@group.Condition)) {
|
||||
if (parentGroup == null)
|
||||
parentGroup = @group;
|
||||
var property = @group.Properties.
|
||||
Where (p => string.IsNullOrEmpty (p.Condition)
|
||||
&& p.Name.Equals (name, StringComparison.OrdinalIgnoreCase)).
|
||||
FirstOrDefault ();
|
||||
if (property != null) {
|
||||
property.Value = value;
|
||||
return property;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (parentGroup == null)
|
||||
parentGroup = AddPropertyGroup ();
|
||||
return parentGroup.AddProperty (name, value);
|
||||
}
|
||||
|
||||
public ProjectPropertyGroupElement AddPropertyGroup ()
|
||||
{
|
||||
var @group = CreatePropertyGroupElement ();
|
||||
var last = PropertyGroupsReversed.FirstOrDefault ();
|
||||
InsertAfterChild (@group, last);
|
||||
return @group;
|
||||
}
|
||||
|
||||
public ProjectTargetElement AddTarget (string name)
|
||||
{
|
||||
var target = CreateTargetElement (name);
|
||||
AppendChild (target);
|
||||
return target;
|
||||
}
|
||||
|
||||
public ProjectUsingTaskElement AddUsingTask (string name, string assemblyFile, string assemblyName)
|
||||
{
|
||||
var usingTask = CreateUsingTaskElement (name, assemblyFile, assemblyName);
|
||||
AppendChild (usingTask);
|
||||
return usingTask;
|
||||
}
|
||||
|
||||
public ProjectChooseElement CreateChooseElement ()
|
||||
{
|
||||
return new ProjectChooseElement (this);
|
||||
}
|
||||
|
||||
public ProjectImportElement CreateImportElement (string project)
|
||||
{
|
||||
return new ProjectImportElement (project, this);
|
||||
}
|
||||
|
||||
public ProjectImportGroupElement CreateImportGroupElement ()
|
||||
{
|
||||
return new ProjectImportGroupElement (this);
|
||||
}
|
||||
|
||||
public ProjectItemDefinitionElement CreateItemDefinitionElement (string itemType)
|
||||
{
|
||||
return new ProjectItemDefinitionElement (itemType, this);
|
||||
}
|
||||
|
||||
public ProjectItemDefinitionGroupElement CreateItemDefinitionGroupElement ()
|
||||
{
|
||||
return new ProjectItemDefinitionGroupElement (this);
|
||||
}
|
||||
|
||||
public ProjectItemElement CreateItemElement (string itemType)
|
||||
{
|
||||
return new ProjectItemElement (itemType, this);
|
||||
}
|
||||
|
||||
public ProjectItemElement CreateItemElement (string itemType, string include)
|
||||
{
|
||||
var item = CreateItemElement (itemType);
|
||||
item.Include = include;
|
||||
return item;
|
||||
}
|
||||
|
||||
public ProjectItemGroupElement CreateItemGroupElement ()
|
||||
{
|
||||
return new ProjectItemGroupElement (this);
|
||||
}
|
||||
|
||||
public ProjectMetadataElement CreateMetadataElement (string name)
|
||||
{
|
||||
return new ProjectMetadataElement (name, this);
|
||||
}
|
||||
|
||||
public ProjectMetadataElement CreateMetadataElement (string name, string unevaluatedValue)
|
||||
{
|
||||
var metadata = CreateMetadataElement (name);
|
||||
metadata.Value = unevaluatedValue;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
public ProjectOnErrorElement CreateOnErrorElement (string executeTargets)
|
||||
{
|
||||
return new ProjectOnErrorElement (executeTargets, this);
|
||||
}
|
||||
|
||||
public ProjectOtherwiseElement CreateOtherwiseElement ()
|
||||
{
|
||||
return new ProjectOtherwiseElement (this);
|
||||
}
|
||||
|
||||
public ProjectOutputElement CreateOutputElement (string taskParameter, string itemType,
|
||||
string propertyName)
|
||||
{
|
||||
return new ProjectOutputElement (taskParameter, itemType, propertyName, this);
|
||||
}
|
||||
|
||||
public ProjectExtensionsElement CreateProjectExtensionsElement ()
|
||||
{
|
||||
return new ProjectExtensionsElement (this);
|
||||
}
|
||||
|
||||
public ProjectPropertyElement CreatePropertyElement (string name)
|
||||
{
|
||||
return new ProjectPropertyElement (name, this);
|
||||
}
|
||||
|
||||
public ProjectPropertyGroupElement CreatePropertyGroupElement ()
|
||||
{
|
||||
return new ProjectPropertyGroupElement (this);
|
||||
}
|
||||
|
||||
public ProjectTargetElement CreateTargetElement (string name)
|
||||
{
|
||||
return new ProjectTargetElement (name, this);
|
||||
}
|
||||
|
||||
public ProjectTaskElement CreateTaskElement (string name)
|
||||
{
|
||||
return new ProjectTaskElement (name, this);
|
||||
}
|
||||
|
||||
public ProjectUsingTaskBodyElement CreateUsingTaskBodyElement (string evaluate, string body)
|
||||
{
|
||||
return new ProjectUsingTaskBodyElement (evaluate, body, this);
|
||||
}
|
||||
|
||||
public ProjectUsingTaskElement CreateUsingTaskElement (string taskName, string assemblyFile,
|
||||
string assemblyName)
|
||||
{
|
||||
return new ProjectUsingTaskElement (taskName, assemblyFile, assemblyName, this);
|
||||
}
|
||||
|
||||
public ProjectUsingTaskParameterElement CreateUsingTaskParameterElement (string name, string output,
|
||||
string required,
|
||||
string parameterType)
|
||||
{
|
||||
return new ProjectUsingTaskParameterElement (name, output, required, parameterType, this);
|
||||
}
|
||||
|
||||
public UsingTaskParameterGroupElement CreateUsingTaskParameterGroupElement ()
|
||||
{
|
||||
return new UsingTaskParameterGroupElement (this);
|
||||
}
|
||||
|
||||
public ProjectWhenElement CreateWhenElement (string condition)
|
||||
{
|
||||
return new ProjectWhenElement (condition, this);
|
||||
}
|
||||
|
||||
public static ProjectRootElement Open (string path)
|
||||
{
|
||||
return Open (path, ProjectCollection.GlobalProjectCollection);
|
||||
}
|
||||
|
||||
public static ProjectRootElement Open (string path, ProjectCollection projectCollection)
|
||||
{
|
||||
var result = Create (path, projectCollection);
|
||||
using (var reader = XmlReader.Create (path))
|
||||
result.Load (reader);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void Save ()
|
||||
{
|
||||
Save (Encoding);
|
||||
}
|
||||
|
||||
public void Save (Encoding saveEncoding)
|
||||
{
|
||||
using (var writer = new StreamWriter (File.Create (FullPath), saveEncoding)) {
|
||||
Save (writer);
|
||||
}
|
||||
}
|
||||
|
||||
public void Save (string path)
|
||||
{
|
||||
Save (path, Encoding);
|
||||
}
|
||||
|
||||
public void Save (TextWriter writer)
|
||||
{
|
||||
using (var xmlWriter = XmlWriter.Create (writer, new XmlWriterSettings { Indent = true,
|
||||
NewLineChars = "\r\n" })) {
|
||||
Save (xmlWriter);
|
||||
}
|
||||
}
|
||||
|
||||
public void Save (string path, Encoding encoding)
|
||||
{
|
||||
FullPath = path;
|
||||
Save (encoding);
|
||||
}
|
||||
|
||||
public static ProjectRootElement TryOpen (string path)
|
||||
{
|
||||
return TryOpen (path, ProjectCollection.GlobalProjectCollection);
|
||||
}
|
||||
|
||||
public static ProjectRootElement TryOpen (string path, ProjectCollection projectCollection)
|
||||
{
|
||||
// this should be non-null only if the project is already cached
|
||||
// and caching is not yet implemented
|
||||
return null;
|
||||
}
|
||||
|
||||
internal override void Load (XmlReader reader)
|
||||
{
|
||||
try {
|
||||
base.Load (reader);
|
||||
} catch (XmlException ex) {
|
||||
throw new InvalidProjectFileException (FullPath, ex.LineNumber, ex.LinePosition, 0, 0,
|
||||
ex.Message, null, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
internal override ProjectElement LoadChildElement (string name)
|
||||
{
|
||||
switch (name) {
|
||||
case "PropertyGroup":
|
||||
var prop = CreatePropertyGroupElement ();
|
||||
AppendChild (prop);
|
||||
return prop;
|
||||
case "ItemGroup":
|
||||
var item = CreateItemGroupElement ();
|
||||
AppendChild (item);
|
||||
return item;
|
||||
case "Import":
|
||||
return AddImport (null);
|
||||
case "Target":
|
||||
return AddTarget (null);
|
||||
case "ItemDefinitionGroup":
|
||||
var def = CreateItemDefinitionGroupElement ();
|
||||
AppendChild (def);
|
||||
return def;
|
||||
case "UsingTask":
|
||||
return AddUsingTask (null, null, null);
|
||||
case "Choose":
|
||||
var choose = CreateChooseElement ();
|
||||
AppendChild (choose);
|
||||
return choose;
|
||||
case "ProjectExtensions":
|
||||
var ext = CreateProjectExtensionsElement ();
|
||||
AppendChild (ext);
|
||||
return ext;
|
||||
default:
|
||||
throw new InvalidProjectFileException (string.Format (
|
||||
"Child \"{0}\" is not a known node type.", name));
|
||||
}
|
||||
}
|
||||
|
||||
internal override void LoadAttribute (string name, string value)
|
||||
{
|
||||
switch (name) {
|
||||
case "ToolsVersion":
|
||||
ToolsVersion = value;
|
||||
break;
|
||||
case "DefaultTargets":
|
||||
DefaultTargets = value;
|
||||
break;
|
||||
case "InitialTargets":
|
||||
InitialTargets = value;
|
||||
break;
|
||||
default:
|
||||
base.LoadAttribute (name, value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
internal override void Save (XmlWriter writer)
|
||||
{
|
||||
writer.WriteStartElement (XmlName, "http://schemas.microsoft.com/developer/msbuild/2003");
|
||||
SaveValue (writer);
|
||||
writer.WriteEndElement ();
|
||||
}
|
||||
|
||||
internal override void SaveValue (XmlWriter writer)
|
||||
{
|
||||
SaveAttribute (writer, "ToolsVersion", ToolsVersion);
|
||||
SaveAttribute (writer, "DefaultTargets", DefaultTargets);
|
||||
SaveAttribute (writer, "InitialTargets", InitialTargets);
|
||||
base.SaveValue (writer);
|
||||
}
|
||||
|
||||
internal override string XmlName {
|
||||
get { return "Project"; }
|
||||
}
|
||||
}
|
||||
}
|
||||
Loaded 100 of 974 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user