Merge pull request #1304 from slluis/mac-proxy-autoconfig
[mono.git] / mcs / tools / mdoc / Makefile
index 4dbe48cea8477f3ff07a00d197356aa964408d39..ad24c3d2d4e2078d16d3c98a6e16b3d7317c2c03 100644 (file)
@@ -2,20 +2,47 @@ thisdir = tools/mdoc
 SUBDIRS = 
 include ../../build/rules.make
 
-LOCAL_MCS_FLAGS = \
-       /resource:../monodoc/Resources/mdoc-html-utils.xsl,mdoc-html-utils.xsl      \
-       /resource:../monodoc/Resources/mdoc-sections-css.xsl,mdoc-sections-css.xsl  \
-       /resource:../monodoc/Resources/mono-ecma-css.xsl,mono-ecma-css.xsl          \
+MDOC_COMMON_FLAGS = \
+       /resource:../../class/monodoc/Resources/mdoc-html-format.xsl,mdoc-html-format.xsl    \
+       /resource:../../class/monodoc/Resources/mdoc-html-utils.xsl,mdoc-html-utils.xsl      \
+       /resource:../../class/monodoc/Resources/mdoc-sections-css.xsl,mdoc-sections-css.xsl  \
+       /resource:../../class/monodoc/Resources/mono-ecma-css.xsl,mono-ecma-css.xsl          \
        /resource:Resources/defaulttemplate.xsl,defaulttemplate.xsl                 \
        /resource:Resources/monodoc-ecma.xsd,monodoc-ecma.xsd                       \
+       /resource:Resources/msitomsx.xsl,msitomsx.xsl                               \
        /resource:Resources/overview.xsl,overview.xsl                               \
        /resource:Resources/stylesheet.xsl,stylesheet.xsl                           \
-       /r:$(topdir)/class/lib/net_1_1/monodoc.dll                                  \
-       /r:$(topdir)/class/lib/net_1_1/Mono.Cecil.dll
+       /r:System.Web.dll                                                           \
+       /r:System.Xml.Linq.dll                                                      \
+       /r:ICSharpCode.SharpZipLib.dll                                              \
+       /r:Mono.Cecil.dll
+
+LOCAL_MCS_FLAGS = $(MDOC_COMMON_FLAGS) \
+       /r:monodoc.dll
+PROGRAM = mdoc.exe
+PROGRAM_DEPS = $(topdir)/class/lib/$(PROFILE)/monodoc.dll
+
+ifdef NET
+all : copy-with-deps
+
+copy-with-deps:
+       -mkdir mdoc-net
+       cp $(PROGRAM) mdoc-net
+       cp $(topdir)/class/lib/$(PROFILE)/Commons.Xml.Relaxng.dll mdoc-net
+       cp $(topdir)/class/lib/$(PROFILE)/ICSharpCode.SharpZipLib.dll mdoc-net
+       cp $(topdir)/class/lib/$(PROFILE)/Mono.Cecil.dll mdoc-net
+       cp $(topdir)/class/lib/$(PROFILE)/monodoc.dll mdoc-net
+endif
+
+MONODOC_RESOURCES = \
+       ../../class/monodoc/Resources/mdoc-html-utils.xsl    \
+       ../../class/monodoc/Resources/mdoc-sections-css.xsl  \
+       ../../class/monodoc/Resources/mono-ecma-css.xsl
 
 MDOC_RESOURCES = \
        Resources/defaulttemplate.xsl     \
        Resources/monodoc-ecma.xsd        \
+       Resources/msitomsx.xsl            \
        Resources/overview.xsl            \
        Resources/stylesheet.xsl
 
@@ -32,16 +59,19 @@ EXTRA_DISTFILES = \
        $(MDOC_RESOURCES) \
        $(MDOC_TEST_FILES)
 
-PROGRAM = mdoc.exe
+$(PROGRAM) : $(MDOC_RESOURCES) $(MONODOC_RESOURCES) $(PROGRAM_DEPS)
 
-$(PROGRAM) : $(MDOC_RESOURCES) $(topdir)/class/lib/net_1_1/monodoc.dll
+PROGRAM_COMPILE = $(CSCOMPILE) -platform:x86
 
 include ../../build/executable.make
 
+$(PROGRAM) : $(build_lib)
+       cp $< $@
+
 $(PROGRAM) : Makefile
 
 MONO = \
-       MONO_PATH="$(topdir)/class/lib/2.0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" \
+       MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" \
        $(RUNTIME) $(RUNTIME_FLAGS)
 
 dist-local: dist-default dist-tests
@@ -58,7 +88,18 @@ clean-local: cleanup
 
 cleanup:
        -rm -Rf Test/en.actual Test/html.actual
-       -rm monodocer1.exe*
+       -rm -f monodocer1.exe*
+
+Test/DocTest-DropNS-classic-secondary.dll:
+       @echo $(value @)
+       $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic-secondary.cs
+
+Test/DocTest-DropNS-classic.dll:
+       @echo $(value @)
+       $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs
+
+Test/DocTest-DropNS-unified.dll:
+       $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs
 
 Test/DocTest.dll: 
        $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest.cs
@@ -76,111 +117,171 @@ Test/DocTest.dll-v2:
        -rm -f Test/DocTest.dll
        $(MAKE) TEST_CSCFLAGS=$(TEST_CSCFLAGS) Test/DocTest.dll
 
-check-monodocer-update: mdoc.exe
+check-monodocer-dropns-classic: $(PROGRAM)
+       # tests the simplest --dropns case, a single class where the root namespace was dropped.
+       -rm -Rf Test/en.actual
+       $(MAKE) Test/DocTest-DropNS-classic.dll
+       $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic.dll
+       $(MAKE) update-monodocer-dropns-unified
+       diff --exclude=.svn -rup Test/en.expected-dropns-classic-v1 Test/en.actual
+
+check-monodocer-dropns-classic-withsecondary: $(PROGRAM)
+       # tests case where a secondary assembly is included with a --dropns parameter
+       -rm -Rf Test/en.actual
+       $(MAKE) Test/DocTest-DropNS-classic.dll
+       $(MAKE) Test/DocTest-DropNS-classic-secondary.dll
+       $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic.dll Test/DocTest-DropNS-classic-secondary.dll
+       $(MAKE) update-monodocer-dropns-unified-withsecondary
+       diff --exclude=.svn -rup Test/en.expected-dropns-classic-withsecondary Test/en.actual
+
+update-monodocer-dropns-unified: $(PROGRAM)
+       $(MAKE) Test/DocTest-DropNS-unified.dll
+       $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-unified.dll --dropns Test/DocTest-DropNS-unified.dll=MyFramework
+
+update-monodocer-dropns-unified-withsecondary: $(PROGRAM)
+       $(MAKE) Test/DocTest-DropNS-unified.dll
+       $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-unified.dll Test/DocTest-DropNS-classic-secondary.dll --dropns Test/DocTest-DropNS-unified.dll=MyFramework
+
+update-monodocer-dropns-classic-secondary: $(PROGRAM)
+       $(MAKE) Test/DocTest-DropNS-classic-secondary.dll
+       $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic-secondary.dll
+               
+
+check-monodocer-update: $(PROGRAM)
        find Test/en.expected -name \*.xml -exec rm "{}" \;
        $(MAKE) Test/DocTest.dll-v1
-       $(MONO) mdoc.exe update --exceptions=all -o Test/en.expected Test/DocTest.dll
+       $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.expected Test/DocTest.dll
 
-check-monodocer: mdoc.exe
+check-monodocer: $(PROGRAM)
        -rm -Rf Test/en.actual
        $(MAKE) Test/DocTest.dll-v1
-       $(MONO) mdoc.exe update --exceptions=all -o Test/en.actual Test/DocTest.dll
+       $(MONO) $(PROGRAM) update --debug --exceptions=all -o Test/en.actual Test/DocTest.dll
        diff --exclude=.svn -rup Test/en.expected Test/en.actual
-       $(MONO) mdoc.exe update --exceptions=all -o Test/en.actual Test/DocTest.dll 
+       $(MONO) $(PROGRAM) update --debug --exceptions=all -o Test/en.actual Test/DocTest.dll 
        diff --exclude=.svn -rup Test/en.expected Test/en.actual
 
-check-monodocer-since-update: mdoc.exe
+check-monodocer-since-update: $(PROGRAM)
        find Test/en.expected.since -name \*.xml -exec rm "{}" \;
        $(MAKE) Test/DocTest.dll-v1
-       $(MONO) mdoc.exe update --exceptions=all -o Test/en.expected.since Test/DocTest.dll 
+       $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.expected.since Test/DocTest.dll 
        $(MAKE) Test/DocTest.dll-v2
-       $(MONO) mdoc.exe update --exceptions=all --since="Version 2.0" \
+       $(MONO) $(PROGRAM) update --exceptions=all --since="Version 2.0" \
                -o Test/en.expected.since Test/DocTest.dll 
 
-check-monodocer-since: mdoc.exe
+check-monodocer-since: $(PROGRAM)
        rm -Rf Test/en.actual
        $(MAKE) Test/DocTest.dll-v1
-       $(MONO) mdoc.exe update --exceptions=all -o Test/en.actual Test/DocTest.dll 
+       $(MONO) $(PROGRAM) --debug update --exceptions=all -o Test/en.actual Test/DocTest.dll 
        $(MAKE) Test/DocTest.dll-v2
-       $(MONO) mdoc.exe update --exceptions=all --since="Version 2.0" \
+       $(MONO) $(PROGRAM) --debug update --exceptions=all --since="Version 2.0" \
                -o Test/en.actual Test/DocTest.dll 
        diff --exclude=.svn -rup Test/en.expected.since Test/en.actual
 
-check-monodocer-importslashdoc-update: mdoc.exe
+check-monodocer-delete-update: $(PROGRAM)
+       find Test/en.expected.delete -type f -exec rm "{}" \;
+       $(MAKE) Test/DocTest.dll-v1
+       $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.expected.delete Test/DocTest.dll
+       $(MAKE) Test/DocTest.dll-v2
+       $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.expected.delete Test/DocTest.dll
+       $(MAKE) Test/DocTest.dll-v1
+       $(MONO) $(PROGRAM) update -fno-assembly-versions --delete --exceptions=all \
+               -o Test/en.expected.delete Test/DocTest.dll
+
+check-monodocer-delete: $(PROGRAM)
+       rm -Rf Test/en.actual
+       $(MAKE) Test/DocTest.dll-v1
+       $(MONO) $(PROGRAM) --debug update --exceptions=all -o Test/en.actual Test/DocTest.dll
+       $(MAKE) Test/DocTest.dll-v2
+       $(MONO) $(PROGRAM) --debug update --exceptions=all -o Test/en.actual Test/DocTest.dll
+       $(MAKE) Test/DocTest.dll-v1
+       $(MONO) $(PROGRAM) --debug update -fno-assembly-versions --delete --exceptions=all -o Test/en.actual Test/DocTest.dll
+       diff --exclude=.svn -rup Test/en.expected.delete Test/en.actual
+
+check-monodocer-importslashdoc-update: $(PROGRAM)
        find Test/en.expected.importslashdoc -name \*.xml -exec rm "{}" \;
        $(MAKE) Test/DocTest.dll-v1 TEST_CSCFLAGS=-doc:Test/DocTest.xml
-       $(MONO) mdoc.exe update --exceptions=all -i Test/DocTest.xml \
+       $(MONO) $(PROGRAM) --debug update --exceptions=all -i Test/DocTest.xml \
                -o Test/en.expected.importslashdoc Test/DocTest.dll 
 
-check-monodocer-importslashdoc: mdoc.exe
+check-monodocer-importslashdoc: $(PROGRAM)
        rm -Rf Test/en.actual
        $(MAKE) Test/DocTest.dll-v1 TEST_CSCFLAGS=-doc:Test/DocTest.xml
-       $(MONO) mdoc.exe update --exceptions=all -i Test/DocTest.xml \
+       $(MONO) $(PROGRAM) --debug update --exceptions=all -i Test/DocTest.xml \
                -o Test/en.actual Test/DocTest.dll 
        diff --exclude=.svn -rup Test/en.expected.importslashdoc Test/en.actual
 
-check-monodocer-importecmadoc-update: mdoc.exe
+check-monodocer-importecmadoc-update: $(PROGRAM)
        find Test/en.expected.importecmadoc -name \*.xml -exec rm "{}" \;
        $(MAKE) Test/DocTest.dll-v1
-       $(MONO) mdoc.exe update --exceptions=all -i Test/TestEcmaDocs.xml \
+       $(MONO) $(PROGRAM) --debug update --exceptions=all -i Test/TestEcmaDocs.xml \
                '--type=System.Action`1' --type=System.AsyncCallback \
                --type=System.Environment --type=System.Array \
                -o Test/en.expected.importecmadoc Test/DocTest.dll 
 
-check-monodocer-importecmadoc: mdoc.exe
+check-monodocer-importecmadoc: $(PROGRAM)
        rm -Rf Test/en.actual
        $(MAKE) Test/DocTest.dll-v1
-       $(MONO) mdoc.exe update --exceptions=all -i Test/TestEcmaDocs.xml \
+       $(MONO) $(PROGRAM) --debug update --exceptions=all -i Test/TestEcmaDocs.xml \
                '--type=System.Action`1' --type=System.AsyncCallback \
                --type=System.Environment --type=System.Array \
                -o Test/en.actual Test/DocTest.dll 
        diff --exclude=.svn -rup Test/en.expected.importecmadoc Test/en.actual
 
-check-mdoc-export-html-update: mdoc.exe
+check-mdoc-export-html-update: $(PROGRAM)
        find Test/html.expected -name \*.html -exec rm "{}" \;
-       $(MONO) mdoc.exe export-html -o Test/html.expected \
+       $(MONO) $(PROGRAM) export-html -o Test/html.expected \
                Test/en.expected.importslashdoc 
 
-check-mdoc-export-html: check-monodocer mdoc.exe
+check-mdoc-export-html: check-monodocer $(PROGRAM)
        rm -Rf Test/html.actual
-       $(MONO) mdoc.exe export-html -o Test/html.actual \
+       $(MONO) $(PROGRAM) export-html -o Test/html.actual \
                Test/en.expected.importslashdoc
        diff --exclude=.svn -rup Test/html.expected Test/html.actual
 
-check-md-html-dir: mdoc.exe
+check-mdoc-export-html-with-version: $(PROGRAM)
+       rm -Rf Test/html.actual.v0 Test/html.actual.since-with-v0 .v0.txt .v2.txt
+       $(MONO) $(PROGRAM) export-html -o Test/html.actual.v0 \
+               Test/en.expected
+       $(MONO) $(PROGRAM) export-html -o Test/html.actual.since-with-v0 \
+               Test/en.expected.since -with-version 0.0.0.0
+       (cd Test/html.actual.v0            && find . -type f) | sort > .v0.txt
+       (cd Test/html.actual.since-with-v0 && find . -type f) | sort > .v2.txt
+       diff -rup .v0.txt .v2.txt   # assert no types added
+
+check-md-html-dir: $(PROGRAM)
        rm -Rf Test/html.actual
-       $(MONO) mdoc.exe export-html -dest:Test/html.actual $(DIR) 
+       $(MONO) $(PROGRAM) export-html -dest:Test/html.actual $(DIR) 
        diff --exclude=.svn -rup Test/html.expected Test/html.actual
 
 check-mdoc-export-msxdoc-update:
-       $(MONO) mdoc.exe export-msxdoc -o - Test/en.expected.importslashdoc \
+       $(MONO) $(PROGRAM) export-msxdoc -o - Test/en.expected.importslashdoc \
                > Test/msxdoc-expected.importslashdoc.xml
 
 check-mdoc-export-msxdoc:
-       $(MONO) mdoc.exe export-msxdoc -o - Test/en.expected.importslashdoc \
+       $(MONO) $(PROGRAM) export-msxdoc -o - Test/en.expected.importslashdoc \
                | diff --brief - Test/msxdoc-expected.importslashdoc.xml
 
 my_abs_top_srcdir = $(shell cd . && pwd)
 
-check-mdoc-validate-update: mdoc.exe
-       $(MONO) mdoc.exe validate -f ecma Test/en.expected 2>&1 | \
+check-mdoc-validate-update: $(PROGRAM)
+       $(MONO) $(PROGRAM) validate -f ecma Test/en.expected 2>&1 | \
                sed 's#file://$(my_abs_top_srcdir)/##g' > \
                Test/validate.check.monodocer
-       $(MONO) mdoc.exe validate -f ecma Test/en.expected.importslashdoc 2>&1 | \
+       $(MONO) $(PROGRAM) validate -f ecma Test/en.expected.importslashdoc 2>&1 | \
                sed 's#file://$(my_abs_top_srcdir)/##g' > \
                Test/validate.check.monodocer.importslashdoc
-       $(MONO) mdoc.exe validate -f ecma Test/en.expected.since 2>&1 | \
+       $(MONO) $(PROGRAM) validate -f ecma Test/en.expected.since 2>&1 | \
                sed 's#file://$(my_abs_top_srcdir)/##g' > \
                Test/validate.check.monodocer.since
 
-check-mdoc-validate: mdoc.exe
-       $(MONO) mdoc.exe validate -f ecma Test/en.expected 2>&1 | \
+check-mdoc-validate: $(PROGRAM)
+       $(MONO) $(PROGRAM) validate -f ecma Test/en.expected 2>&1 | \
                sed 's#file://$(my_abs_top_srcdir)/##g' | \
                diff - Test/validate.check.monodocer
-       $(MONO) mdoc.exe validate -f ecma Test/en.expected.importslashdoc 2>&1 | \
+       $(MONO) $(PROGRAM) validate -f ecma Test/en.expected.importslashdoc 2>&1 | \
                sed 's#file://$(my_abs_top_srcdir)/##g' | \
                diff --brief - Test/validate.check.monodocer.importslashdoc
-       $(MONO) mdoc.exe validate -f ecma Test/en.expected.since 2>&1 | \
+       $(MONO) $(PROGRAM) validate -f ecma Test/en.expected.since 2>&1 | \
                sed 's#file://$(my_abs_top_srcdir)/##g' | \
                diff --brief - Test/validate.check.monodocer.since
 
@@ -192,7 +293,9 @@ check-doc-tools: check-monodocer-since \
        check-monodocer-importecmadoc \
        check-monodocer-importslashdoc \
        check-monodocer \
+       check-monodocer-delete \
        check-mdoc-export-html \
+       check-mdoc-export-html-with-version \
        check-mdoc-export-msxdoc \
        check-mdoc-validate
 
@@ -200,7 +303,11 @@ check-doc-tools-update: check-monodocer-since-update \
        check-monodocer-importecmadoc-update \
        check-monodocer-importslashdoc-update \
        check-monodocer-update \
+       check-monodocer-dropns-classic \
+       check-monodocer-dropns-classic-withsecondary \
+       check-monodocer-delete-update \
        check-mdoc-export-html-update \
        check-mdoc-export-msxdoc-update \
-       check-mdoc-validate-update
+       check-mdoc-validate-update 
+