Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
bingbingbingbing
mono
提交
dee36bfa
M
mono
项目概览
bingbingbingbing
/
mono
与 Fork 源项目一致
从无法访问的项目Fork
通知
35
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mono
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
dee36bfa
编写于
2月 04, 2015
作者:
M
Miguel de Icaza
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Start work to generate dependencies
上级
2baec073
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
55 addition
and
9 deletion
+55
-9
msvc/scripts/genproj.cs
msvc/scripts/genproj.cs
+55
-9
未找到文件。
msvc/scripts/genproj.cs
浏览文件 @
dee36bfa
...
...
@@ -38,7 +38,7 @@ class SlnGenerator {
const
string
project_start
=
"Project(\"{{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}}\") = \"{0}\", \"{1}\", \"{2}\""
;
// Note: No need to double up on {} around {2}
const
string
project_end
=
"EndProject"
;
List
<
MsbuildGenerator
.
VsCsproj
>
libraries
=
new
List
<
MsbuildGenerator
.
VsCsproj
>
();
public
List
<
MsbuildGenerator
.
VsCsproj
>
libraries
=
new
List
<
MsbuildGenerator
.
VsCsproj
>
();
string
header
;
string
MakeHeader
(
string
formatVersion
,
string
yearTag
)
...
...
@@ -123,7 +123,7 @@ class MsbuildGenerator {
}
// The directory as specified in order.xml
string
dir
;
public
string
dir
;
string
library
;
string
projectGuid
;
string
fx_version
;
...
...
@@ -153,7 +153,8 @@ class MsbuildGenerator {
projectGuid
=
this
.
projectGuid
,
library_output
=
this
.
LibraryOutput
,
fx_version
=
double
.
Parse
(
fx_version
),
library
=
this
.
library
library
=
this
.
library
,
MsbuildGenerator
=
this
};
if
(
dir
==
"mcs"
)
{
...
...
@@ -621,6 +622,7 @@ class MsbuildGenerator {
public
double
fx_version
;
public
List
<
VsCsproj
>
projReferences
=
new
List
<
VsCsproj
>
();
public
string
library
;
public
MsbuildGenerator
MsbuildGenerator
;
}
public
VsCsproj
Csproj
;
...
...
@@ -916,7 +918,7 @@ class MsbuildGenerator {
result
.
projReferences
.
Add
(
match
.
Csproj
);
}
static
string
GetRelativePath
(
string
from
,
string
to
)
public
static
string
GetRelativePath
(
string
from
,
string
to
)
{
from
=
from
.
Replace
(
"\\"
,
"/"
);
to
=
to
.
Replace
(
"\\"
,
"/"
);
...
...
@@ -964,7 +966,7 @@ class MsbuildGenerator {
public
class
Driver
{
static
IEnumerable
<
XElement
>
GetProjects
()
static
IEnumerable
<
XElement
>
GetProjects
(
bool
full
=
false
)
{
XDocument
doc
=
XDocument
.
Load
(
"order.xml"
);
foreach
(
XElement
project
in
doc
.
Root
.
Elements
())
{
...
...
@@ -978,6 +980,12 @@ public class Driver {
if
(!(
dir
.
StartsWith
(
"class"
)
||
dir
.
StartsWith
(
"mcs"
)
||
dir
.
StartsWith
(
"basic"
)))
continue
;
if
(
full
){
if
(!
library
.
Contains
(
"tests"
))
yield
return
project
;
continue
;
}
//
// Do not do 2.1, it is not working yet
// Do not do basic, as there is no point (requires a system mcs to be installed).
...
...
@@ -1009,12 +1017,18 @@ public class Driver {
Console
.
WriteLine
(
" assemblies (and dependencies) is included in the solution."
);
Console
.
WriteLine
(
"Example:"
);
Console
.
WriteLine
(
"genproj.exe 2012 false"
);
Console
.
WriteLine
(
"genproj.exe with no arguments is equivalent to 'genproj.exe 2012 true'"
);
Console
.
WriteLine
(
"genproj.exe with no arguments is equivalent to 'genproj.exe 2012 true'\n\n"
);
Console
.
WriteLine
(
"genproj.exe deps"
);
Console
.
WriteLine
(
"Generates a Makefile dependency file from the projects input"
);
Environment
.
Exit
(
0
);
}
var
slnVersion
=
(
args
.
Length
>
0
)
?
args
[
0
]
:
"2012"
;
bool
fullSolutions
=
(
args
.
Length
>
1
)
?
bool
.
Parse
(
args
[
1
])
:
true
;
// To generate makefile depenedencies
var
makefileDeps
=
(
args
.
Length
>
0
&&
args
[
0
]
==
"deps"
);
var
sln_gen
=
new
SlnGenerator
(
slnVersion
);
var
two_sln_gen
=
new
SlnGenerator
(
slnVersion
);
var
four_sln_gen
=
new
SlnGenerator
(
slnVersion
);
...
...
@@ -1023,11 +1037,11 @@ public class Driver {
var
projects
=
new
Dictionary
<
string
,
MsbuildGenerator
>
();
var
duplicates
=
new
List
<
string
>
();
foreach
(
var
project
in
GetProjects
())
{
foreach
(
var
project
in
GetProjects
(
makefileDeps
))
{
var
library_output
=
project
.
Element
(
"library_output"
).
Value
;
projects
[
library_output
]
=
new
MsbuildGenerator
(
project
);
}
foreach
(
var
project
in
GetProjects
()){
foreach
(
var
project
in
GetProjects
(
makefileDeps
)){
var
library_output
=
project
.
Element
(
"library_output"
).
Value
;
var
gen
=
projects
[
library_output
];
try
{
...
...
@@ -1064,6 +1078,26 @@ public class Driver {
WriteSolution
(
four_sln_gen
,
MakeSolutionName
(
MsbuildGenerator
.
profile_4_0
));
WriteSolution
(
four_five_sln_gen
,
MakeSolutionName
(
MsbuildGenerator
.
profile_4_5
));
if
(
makefileDeps
){
const
string
classDirPrefix
=
"./../../"
;
Console
.
WriteLine
(
"here {0}"
,
sln_gen
.
libraries
.
Count
);
foreach
(
var
p
in
sln_gen
.
libraries
){
string
rebasedOutput
=
RebaseToClassDirectory
(
MsbuildGenerator
.
GetRelativePath
(
"../../mcs/class"
,
p
.
library_output
));
Console
.
Write
(
"{0}: "
,
rebasedOutput
);
foreach
(
var
r
in
p
.
projReferences
){
var
lo
=
r
.
library_output
;
if
(
lo
.
StartsWith
(
classDirPrefix
))
lo
=
lo
.
Substring
(
classDirPrefix
.
Length
);
else
lo
=
"<<ERROR-dependency is not a class library>>"
;
Console
.
Write
(
"{0} "
,
lo
);
}
Console
.
Write
(
"\n\t(cd {0}; make {1})"
,
p
.
MsbuildGenerator
.
dir
,
p
.
library_output
);
Console
.
WriteLine
(
"\n"
);
}
}
// A few other optional solutions
// Solutions with 'everything' and the most common libraries used in development may be of interest
//WriteSolution (sln_gen, "mcs_full.sln");
...
...
@@ -1073,6 +1107,18 @@ public class Driver {
//WriteSolution (build_sln_gen, "mcs_build.sln");
}
// Rebases a path, assuming that execution is taking place in the "class" subdirectory,
// so it strips ../class/ from a path, which is a no-op
static
string
RebaseToClassDirectory
(
string
path
)
{
const
string
prefix
=
"../class/"
;
int
p
=
path
.
IndexOf
(
prefix
);
if
(
p
==
-
1
)
return
path
;
return
path
.
Substring
(
0
,
p
)
+
path
.
Substring
(
p
+
prefix
.
Length
);
return
path
;
}
static
string
MakeSolutionName
(
string
profileTag
)
{
return
"net"
+
profileTag
+
".sln"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录