Skip to content
This repository was archived by the owner on Oct 27, 2023. It is now read-only.

Commit 614c25c

Browse files
committed
Update README with new steps
Move shell commands into separate script and make it more robust.
1 parent 63e7ddd commit 614c25c

File tree

2 files changed

+56
-21
lines changed

2 files changed

+56
-21
lines changed

Diff for: README.md

+23-21
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1-
Mono binary reference assemblies repository.
1+
Mono binary reference assemblies
2+
================================
23

34
Built using csc 2.1.0.
45

5-
Use the following steps to add a new .NET profile:
6+
Adding a new .NET profile
7+
-------------------------
68

7-
```bash
8-
NETFXPROFILE=v4.7.1
9+
Use the following steps (we're using 4.7.1 as example):
910

10-
11-
cd $NETFXPROFILE-ms
12-
for i in *.dll; do mono ../../api-snapshot/tools/genapi/GenAPI.exe -assembly:$i -out:../src/$NETFXPROFILE -typeforwardedTo -assemblyVersion -assemblyAttributes -headerFile:../../api-snapshot/profiles/license-header.txt -libPath:.; done
13-
14-
cd ../src/$NETFXPROFILE
15-
for i in *.cs; do sed -i "" 's/AssemblyCompanyAttribute("Microsoft Corporation")/AssemblyCompanyAttribute("Mono development team")/g' $i; done
16-
for i in *.cs; do sed -i "" 's/AssemblyCopyrightAttribute("© Microsoft Corporation. All rights reserved.")/AssemblyCopyrightAttribute("(c) Various Mono authors")/g' $i; done
17-
for i in *.cs; do sed -i "" 's/AssemblyProductAttribute("Microsoft® .NET Framework")/AssemblyProductAttribute("Mono Common Language Infrastructure")/g' $i; done
18-
for i in *.cs; do sed -i "" '/.*AssemblySignatureKeyAttribute(.*]/d' $i; done
19-
for i in *.cs; do sed -i "" '/.*InternalsVisibleToAttribute(.*]/d' $i; done
20-
for i in *.cs; do sed -i "" '/.*DependencyAttribute(.*]/d' $i; done
21-
22-
... Revert changes to Accessibility.cs, Microsoft.VisualC.cs and Microsoft.VisualBasic.cs (bug in GenApi) ...
23-
... Revert changes to System.Workflow.*.cs, System.Web.Mobile.cs and System.Deployment.cs (we only have stub assemblies) ...
24-
... Revert changes to System.Web.WebPages.*.cs, System.Web.Http.*.cs, System.Web.Razor.cs, System.Web.Mvc.cs, System.Net.Http.Formatting.cs and System.Json.Microsoft.cs (wrong AssemblyCompanyAttribute sed replacement) ...
25-
... Revert changes that remove #if / #endif ...
26-
```
11+
1. Copy existing `v4.7/Makefile` and `src/v4.7/*` to new folders and commit
12+
2. Update `PROFILE` variable in `v4.7.1/Makefile`
13+
3. Wire up new profile in `Makefile` in repo root
14+
4. Run the generation script `./generate-refasm-sources.sh v4.7.1 some/path/to/netfx/referenceassemblies`
15+
5. Revert deletion of `*.extra.cs`
16+
6. Revert changes that remove `#if / #endif`
17+
7. Revert suspicious changes to:
18+
- `Accessibility.cs` (bug in GenApi)
19+
- `Microsoft.VisualBasic.cs` (bug in GenApi and wrong AssemblyCopyright/Product attribute)
20+
- `Microsoft.VisualC.cs` (bug in GenApi)
21+
- `System.Data.Linq.cs` (bug in GenApi)
22+
- `System.Deployment.cs` (we only have stub assemblies)
23+
- `System.Runtime.DurableInstancing.cs` (bug in GenApi)
24+
- `System.Security.cs` (bug in GenApi)
25+
- `System.Web.Mobile.cs` (we only have stub assemblies)
26+
- `System.Workflow.*.cs` (we only have stub assemblies)
27+
8. Add new assemblies/facades to `v4.7.1/Makefile`
28+
9. Run `make -C v4.7.1` and ensure everything compiles

Diff for: generate-refasm-sources.sh

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash -e
2+
3+
REPODIR=$( cd "$(dirname "${BASH_SOURCE[0]}")" && pwd )
4+
NETFXPROFILE=$1
5+
NETFXSOURCE=$( cd "$2" && pwd )
6+
7+
if [ "x$NETFXPROFILE" = "x" ]; then echo "No profile specified."; exit 1; fi
8+
if [ ! -d "$NETFXSOURCE" ]; then echo "Reference assemblies folder doesn't exist."; exit 1; fi
9+
10+
rm -f "$REPODIR/src/$NETFXPROFILE"/*.cs
11+
rm -f "$REPODIR/src/$NETFXPROFILE/Facades"/*.cs
12+
13+
cd "$NETFXSOURCE"
14+
for i in *.dll Facades/*.dll; do
15+
if [ "$i" = "System.EnterpriseServices.Thunk.dll" ] || [ "$i" = "System.EnterpriseServices.Wrapper.dll" ]; then continue; fi;
16+
17+
outpath="$REPODIR/src/$NETFXPROFILE"
18+
if [[ "$i" = "Facades"* ]]; then outpath="$outpath/Facades"; fi
19+
20+
echo "Processing $i"
21+
mono "$REPODIR/../api-snapshot/tools/genapi/GenAPI.exe" -assembly:"$i" -out:"$outpath" -typeforwardedTo -assemblyVersion -assemblyAttributes -headerFile:"$REPODIR/../api-snapshot/profiles/license-header.txt" -libPath:"$NETFXSOURCE"
22+
done
23+
24+
cd "$REPODIR/src/$NETFXPROFILE"
25+
for i in *.cs Facades/*.cs; do sed -i "" 's/AssemblyCompanyAttribute("Microsoft Corporation")/AssemblyCompanyAttribute("Mono development team")/g' "$i"; done
26+
for i in *.cs Facades/*.cs; do sed -i "" 's/AssemblyCopyrightAttribute("© Microsoft Corporation. All rights reserved.")/AssemblyCopyrightAttribute("(c) Various Mono authors")/g' "$i"; done
27+
for i in *.cs Facades/*.cs; do sed -i "" 's/AssemblyProductAttribute("Microsoft® .NET Framework")/AssemblyProductAttribute("Mono Common Language Infrastructure")/g' "$i"; done
28+
for i in *.cs Facades/*.cs; do sed -i "" '/.*AssemblySignatureKeyAttribute(.*]/d' "$i"; done
29+
for i in *.cs Facades/*.cs; do sed -i "" '/.*InternalsVisibleToAttribute(.*]/d' "$i"; done
30+
for i in *.cs Facades/*.cs; do sed -i "" '/.*DependencyAttribute(.*]/d' "$i"; done
31+
32+
# remove assembly that we don't have in Mono
33+
rm ISymWrapper.cs Microsoft.Activities.Build.cs Microsoft.Build.Conversion.v4.0.cs Microsoft.JScript.cs Microsoft.VisualBasic.Compatibility.cs Microsoft.VisualBasic.Compatibility.Data.cs Microsoft.VisualC.STLCLR.cs PresentationBuildTasks.cs PresentationCore.cs PresentationFramework.Aero.cs PresentationFramework.Aero2.cs PresentationFramework.AeroLite.cs PresentationFramework.Classic.cs PresentationFramework.cs PresentationFramework.Luna.cs PresentationFramework.Royale.cs ReachFramework.cs sysglobl.cs System.Activities.Core.Presentation.cs System.Activities.cs System.Activities.DurableInstancing.cs System.Activities.Presentation.cs System.AddIn.Contract.cs System.AddIn.cs System.ComponentModel.Composition.Registration.cs System.Data.Entity.Design.cs System.Data.Services.Design.cs System.Data.SqlXml.cs System.Device.cs System.DirectoryServices.AccountManagement.cs System.IdentityModel.Services.cs System.IO.Log.cs System.Management.Instrumentation.cs System.Printing.cs System.ServiceModel.Activities.cs System.ServiceModel.Channels.cs System.Speech.cs System.Web.DataVisualization.cs System.Web.DataVisualization.Design.cs System.Web.DynamicData.Design.cs System.Web.Entity.cs System.Web.Entity.Design.cs System.Windows.Controls.Ribbon.cs System.Windows.Forms.DataVisualization.Design.cs System.Windows.Input.Manipulations.cs System.Windows.Presentation.cs System.WorkflowServices.cs UIAutomationClient.cs UIAutomationClientsideProviders.cs UIAutomationProvider.cs UIAutomationTypes.cs WindowsFormsIntegration.cs XamlBuildTask.cs

0 commit comments

Comments
 (0)