From: Juerg Billeter Date: Sat, 1 Sep 2007 11:44:15 +0000 (+0000) Subject: add xsltproc as optional dependency add initial structure for the Vala X-Git-Tag: VALA_0_1_4~87 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4aae90e672bdeb6348def24cff0feb6a2f2b1df3;p=thirdparty%2Fvala.git add xsltproc as optional dependency add initial structure for the Vala 2007-09-01 Juerg Billeter * configure.ac: add xsltproc as optional dependency * doc/vala/: add initial structure for the Vala Reference Manual, will be built and installed if xsltproc is available * tests/hello.exp, tests/hello.vala: add hello world test case * doc/Makefile.am, tests/Makefile.am: updated svn path=/trunk/; revision=561 --- diff --git a/ChangeLog b/ChangeLog index a2cf88821..32d3f1614 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-09-01 Jürg Billeter + + * configure.ac: add xsltproc as optional dependency + * doc/vala/: add initial structure for the Vala Reference Manual, will + be built and installed if xsltproc is available + * tests/hello.exp, tests/hello.vala: add hello world test case + * doc/Makefile.am, tests/Makefile.am: updated + 2007-09-01 Jürg Billeter * vala/valasemanticanalyzer.vala: check arguments of methods with diff --git a/configure.ac b/configure.ac index dd8604f57..f68cffad3 100644 --- a/configure.ac +++ b/configure.ac @@ -37,6 +37,9 @@ PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) +AC_PATH_PROG([XSLTPROC], [xsltproc], :) +AM_CONDITIONAL(HAVE_XSLTPROC, test "$XSLTPROC" != :) + PKG_CHECK_MODULES(ENCHANT, enchant >= $ENCHANT_REQUIRED, have_enchant=yes, have_enchant=no) AM_CONDITIONAL(HAVE_ENCHANT, test x$have_enchant = xyes) @@ -53,6 +56,7 @@ AC_CONFIG_FILES([Makefile vapi/Makefile tests/Makefile doc/Makefile + doc/vala/Makefile gobject-introspection/Makefile vapigen/Makefile vapigen/gidlgen/Makefile diff --git a/doc/Makefile.am b/doc/Makefile.am index 84f0410e5..16a19c3d8 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,5 +1,9 @@ NULL = +SUBDIRS = \ + vala \ + $(NULL) + if ENABLE_VAPIGEN VAPIGEN_MANS = \ gidlgen.1 \ diff --git a/doc/vala/Makefile.am b/doc/vala/Makefile.am new file mode 100644 index 000000000..66882683f --- /dev/null +++ b/doc/vala/Makefile.am @@ -0,0 +1,59 @@ +bookdir=$(datadir)/devhelp/books/vala + +chapter_data = \ + overview.html \ + types.html \ + expressions.html \ + statements.html \ + namespaces.html \ + classes.html \ + structs.html \ + interfaces.html \ + enums.html \ + delegates.html \ + $(NULL) + +built_data = \ + index.html \ + $(chapter_data) \ + vala.devhelp2 \ + $(NULL) + +if HAVE_XSLTPROC +book_DATA = \ + $(built_data) \ + default.css \ + $(NULL) +endif + +index.html: $(book_sources) xhtml.xsl + $(XSLTPROC) --xinclude $(srcdir)/xhtml.xsl $(srcdir)/index.xml > index.html + +$(chapter_data): index.html + +vala.devhelp2: $(book_sources) devhelp.xsl + $(XSLTPROC) --xinclude $(srcdir)/devhelp.xsl $(srcdir)/index.xml > vala.devhelp2 + +book_sources = \ + index.xml \ + overview.xml \ + types.xml \ + expressions.xml \ + statements.xml \ + namespaces.xml \ + classes.xml \ + structs.xml \ + interfaces.xml \ + enums.xml \ + delegates.xml \ + $(NULL) + +MOSTLYCLEANFILES = $(built_data) + +EXTRA_DIST = \ + $(book_sources) \ + default.css \ + xhtml.xsl \ + devhelp.xsl \ + $(NULL) + diff --git a/doc/vala/classes.xml b/doc/vala/classes.xml new file mode 100644 index 000000000..1d23b444f --- /dev/null +++ b/doc/vala/classes.xml @@ -0,0 +1,5 @@ + +
+ Classes +
+ diff --git a/doc/vala/default.css b/doc/vala/default.css new file mode 100644 index 000000000..a49a2c661 --- /dev/null +++ b/doc/vala/default.css @@ -0,0 +1,48 @@ +body { + font-family: sans-serif; + margin-top: 2.8em; +} + +h1, h2, h3 { + color: #005a9c; +} + +a { + color: #005a9c; + text-decoration: none; +} + +.toc { + font-weight: bold; + font-size: larger; +} + +.toc li { + list-style-type: none; +} + +.toc li li { + font-size: smaller; +} + +h3 a { + /* ensure anchors don't vanish below the fixed header */ + position: relative; + top: -2.8em; +} + +.header { + background-color: #005a9c; + font-weight: bold; + padding: .35em; + position: fixed; + left: 0; + top: 0; + width: 100%; + height: 1.4em; +} + +.header a { + color: white; +} + diff --git a/doc/vala/delegates.xml b/doc/vala/delegates.xml new file mode 100644 index 000000000..0517ed965 --- /dev/null +++ b/doc/vala/delegates.xml @@ -0,0 +1,5 @@ + +
+ Delegates +
+ diff --git a/doc/vala/devhelp.xsl b/doc/vala/devhelp.xsl new file mode 100644 index 000000000..735ff18be --- /dev/null +++ b/doc/vala/devhelp.xsl @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/doc/vala/enums.xml b/doc/vala/enums.xml new file mode 100644 index 000000000..5b136752d --- /dev/null +++ b/doc/vala/enums.xml @@ -0,0 +1,5 @@ + +
+ Enums +
+ diff --git a/doc/vala/expressions.xml b/doc/vala/expressions.xml new file mode 100644 index 000000000..95e937e38 --- /dev/null +++ b/doc/vala/expressions.xml @@ -0,0 +1,5 @@ + +
+ Expressions +
+ diff --git a/doc/vala/index.xml b/doc/vala/index.xml new file mode 100644 index 000000000..1a45706be --- /dev/null +++ b/doc/vala/index.xml @@ -0,0 +1,20 @@ + + + + Vala Reference Manual + + + Vala Reference Manual + + + + + + + + + + + + + diff --git a/doc/vala/interfaces.xml b/doc/vala/interfaces.xml new file mode 100644 index 000000000..a6925117f --- /dev/null +++ b/doc/vala/interfaces.xml @@ -0,0 +1,5 @@ + +
+ Interfaces +
+ diff --git a/doc/vala/namespaces.xml b/doc/vala/namespaces.xml new file mode 100644 index 000000000..da568ff55 --- /dev/null +++ b/doc/vala/namespaces.xml @@ -0,0 +1,5 @@ + +
+ Namespaces +
+ diff --git a/doc/vala/overview.xml b/doc/vala/overview.xml new file mode 100644 index 000000000..7748d84ab --- /dev/null +++ b/doc/vala/overview.xml @@ -0,0 +1,30 @@ + +
+ Overview +

Vala is a new programming language that aims to bring modern programming language features to GNOME developers without imposing any additional runtime requirements and without using a different ABI compared to applications and libraries written in C.

+
+ Getting started +

The classic "Hello, world" example in Vala:

+ +using GLib; + +public class Sample : Object { + public Sample () { + } + + public void run () { + stdout.printf ("Hello, world!\n"); + } + + static int main (string[] args) { + var sample = new Sample (); + sample.run (); + return 0; + } +} +

Store the code in a file whose name ends in ".vala", such as hello.vala, and compile it with the command:

+ valac -o hello hello.vala +

This will produce an executable file called hello.

+
+
+ diff --git a/doc/vala/statements.xml b/doc/vala/statements.xml new file mode 100644 index 000000000..421bc9478 --- /dev/null +++ b/doc/vala/statements.xml @@ -0,0 +1,5 @@ + +
+ Statements +
+ diff --git a/doc/vala/structs.xml b/doc/vala/structs.xml new file mode 100644 index 000000000..478f302c4 --- /dev/null +++ b/doc/vala/structs.xml @@ -0,0 +1,5 @@ + +
+ Structs +
+ diff --git a/doc/vala/types.xml b/doc/vala/types.xml new file mode 100644 index 000000000..55954c670 --- /dev/null +++ b/doc/vala/types.xml @@ -0,0 +1,5 @@ + +
+ Types +
+ diff --git a/doc/vala/xhtml.xsl b/doc/vala/xhtml.xsl new file mode 100644 index 000000000..0f5ac8bf6 --- /dev/null +++ b/doc/vala/xhtml.xsl @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + <xsl:value-of select="."/> + + + +
+ +
+ +
    + +
  • + + +
      + +
    • +
      +
    +
    +
  • +
    +
+ +
+ +

+
+ + + + + <xsl:value-of select="h/text()"/> - <xsl:value-of select="//title/text()"/> + + + +
+ +
+ + + +
+
+ +

+
+ + + + +

+
+ +

+
+ + + + +
+
+
+ diff --git a/tests/Makefile.am b/tests/Makefile.am index 036bddce5..af64e4e30 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -33,6 +33,7 @@ testenchant.stamp: $(filter %.vala,$(testenchant_SOURCES)) TESTS_ENVIRONMENT = $(srcdir)/testrunner.sh TESTS = \ + hello.vala \ test-001.vala \ test-002.vala \ test-003.vala \ @@ -72,41 +73,8 @@ TESTS = \ EXTRA_DIST = \ testrunner.sh \ - test-001.vala \ - test-002.vala \ - test-003.vala \ - test-004.vala \ - test-005.vala \ - test-006.vala \ - test-007.vala \ - test-008.vala \ - test-009.vala \ - test-010.vala \ - test-011.vala \ - test-012.vala \ - test-013.vala \ - test-014.vala \ - test-015.vala \ - test-016.vala \ - test-017.vala \ - test-018.vala \ - test-019.vala \ - test-020.vala \ - test-021.vala \ - test-022.vala \ - test-023.vala \ - test-024.vala \ - test-025.vala \ - test-026.vala \ - test-027.vala \ - test-028.vala \ - test-029.vala \ - test-030.vala \ - test-031.vala \ - test-032.vala \ - test-033.vala \ - test-034.vala \ - test-035.vala \ + $(TESTS) \ + hello.exp \ test-001.exp \ test-002.exp \ test-003.exp \ diff --git a/tests/hello.exp b/tests/hello.exp new file mode 100644 index 000000000..af5626b4a --- /dev/null +++ b/tests/hello.exp @@ -0,0 +1 @@ +Hello, world! diff --git a/tests/hello.vala b/tests/hello.vala new file mode 100644 index 000000000..ddc560318 --- /dev/null +++ b/tests/hello.vala @@ -0,0 +1,17 @@ +using GLib; + +public class Sample : Object { + public Sample () { + } + + public void run () { + stdout.printf ("Hello, world!\n"); + } + + static int main (string[] args) { + var sample = new Sample (); + sample.run (); + return 0; + } +} +