VBNET:WikiCompiler

From GPWiki

Files:GUITutorial_warn.gif The Game Programming Wiki has moved! Files:GUITutorial_warn.gif

The wiki is now hosted by GameDev.NET at wiki.gamedev.net. All gpwiki.org content has been moved to the new server.

However, the GPWiki forums are still active! Come say hello.

Contents

Introduction

This is the project page for the WikiCompiler app. The WikiCompiler app uses "wiki power" to compile community driven programming projects.

WikiCompiler.zip 69Kb (Release 3 - April 9, 2005)

NOTE: I (Created by: X) have been absent from this project for a little while but now I am back. But I my or may not continue to update this project. If I do update it I will be quite different then it is now. I still find the idea quite interesting.

Application overview

First Run

This is what you will see when you first start the app...

Files:WikiCompilerMain.gif

Source URL: The source url refers to the project page on the web. This url does not even have to be a Wiki page it can be any type of html web page.
Projects: The projects list and "Compile All" checkbox have not been implemented yet in Release 2 of the compiler.
Compile: When the "Compile" button is clicked the web page specified in the Source URL text box will be downloaded and parsed for specific WikiCompiler tags. The compiler will then attempt to compile the source code it recieved from the web page. For more info on what tags the WikiCompiler currently supports see below.
Get Projects: The "Get Projects" button will get the list of projects located in the web page specified in the Source URL text box. This feature is not yet fully implemented in Release 2.

The Output Tab

Files:WikiCompilerOutput.gif

Output Tab: When you click the "Compile" button WikiCompiler will automatically show this tab. When the app is compiling it will write compile information into the text box.

The Options Tab

Files:WikiCompilerOptions.gif

Destination Folder: Allows you to specify the location that you would like to place the compiled assembly files. If you do not specify a folder then any compiled assemblies will be placed in the same folder as the WikiCompiler app.
Specify download URL filename: Allows you to specify an actual filename for the downloaded web page. If you leave this blank a temp file will be used.
Override project type: Allows you override the type of assembly that will be produced when compiling. This will override the setting in a PROJECTSTART tag. EXE will produce a Windows Executable. DLL Will produce a Library assembly. Console Will produce a console based application. For more info on what tags the WikiCompiler currently supports see below.
Override entry point: Allows you to override the entry point for the project. If left blank the compiler will search for a "Sub Main" method within the code and use that as the applications entry point. If you wish to specify an entry point you will need to specify the name of the class that contains the method name you want to be the entry point. (For example "MyForm.StartApp"). A applications Entry point is the first method within the app that gets called.
Include debug information on build: Allows you to specify weather or not debug info will be saved for the compiled assembly. This is a DEBUG / RELEASE toggle switch.
Compiler options: Allows you to specify additional compiler command line arguments. NOTE: if you use are overriding the project type, the apropreate /Target command line argument will be passed to the compiler.

Compiler Tags

Formatting

The WikiCompiler regognizes tags that are structured as fallows... All tags are wrapped in [[[ and ]]] that define an individual tag. Following the [[[ is the name of the tag. The compiler determins the end of the tags name by looking for a colon ":" character. The colon ":" character is used to separate the name of the tag from the tags parameters. Everything defined between the colon ":" and ]]] will be the tags parameters. Tag parameters are separated by three colons ":::".

Currently Implemented Tags

  • [[[PROJECTSTART: ]]] and [[[PROJECTEND: ]]]

The PROJECTSTART and PROJECTEND tags define the start and end of a project. A PROJECTSTART tag also must contain two parameters. The first parameter is the name of the project. The second parameter defines the type of assembly the project will be compiled into. The second "Project Type" parameter must be EXE, DLL, or CON. EXE=Windows app DLL=Library CON=Console app. The PROJECTEND tag must contain one parameter, and it must be the same as the first parameter defined in the PROJECTSTART tags. This is how the compiler knows where a project starts and ends within a web page.

  • [[[REFERENCE: ]]]

The REFERENCE tags define the start and end of a project reference and must reside between a PROJECTSTART tag and the first decloration of a FILESTART tags. It is beast to add any REFERENCE tags immediatly fallowing a PROJECTSTART tag. A REFERENCE tag also must contain one parameter. The parameter will be the filename of a assembly file that the project will need in order to successfully compile. Most often then not you will need to add a reference to the System.dll assembly. For example [[[REFERENCE:System.dll]]]

  • [[[FILESTART: ]]] and [[[FILEEND: ]]]

The FILESTART and FILEEND tags define the start and end of a code file for the project and must reside between PROJECTSTART and PROJECTEND tags. A FILESTART tag also must contain one parameter. The parameter will be the filename of the code file. So for example if the code was written in vb.net the file should end with a .vb extention. The FILEEND tag must contain one parameter, and it must be the same as the first parameter defined in the FILESTART tag. This is how the compiler knows where a code file starts and ends within the web page. In order for the code to be parsed and compiled properly the compiler will only compile the code that it finds within the first defined <pre> </pre> tag. This is to ensure that the code does not get malformed. And allows it to stand out as code within the wiki page.

Tags that Still Need Implementing

Source Pages

[[[SOURCE:http://www.someurl.com/ProjectPage1.htm]]] <-- not yet implemented
[[[SOURCE:http://www.someurl.com/ProjectPage2.htm]]] <-- not yet implemented

Source pages will allow a project to exist across multiple web pages.

Entry Point

[[[ENTRYPOINT: ]]] <-- not yet implemented

The entry point tag will allow people to specify what method should be the project entry point.

Embedded Resources

[[[EMBEDRESOURCE: ]]] <-- not yet implemented

Will allow additional files to be embedded into the compiled project as a embeded resource.

Content Files

[[[CONTENT: ]]] <-- not yet implemented

Will allow additional files to be associated with the project. Such as doumentation files or media files etc.

The Language Tag

[[[LANGUAGE: ]]] <-- not yet implemented

Will allow users to specify what programming language the project is written in. Currently only VB.NET is supported but C# will be added at a later time as well. (This is not a difficult task)

The Additional Files Tag

[[[ADDITIONALFILE: ]]] <-- not yet implemented

Will allow additional files to be associated with the project. This tag will probably not be added. users whould use a CONTENT tag to include any additional files with the project.

A "Bin" folder Tag

[[[BINFOLDER: ]]] <-- not yet implemented

Will allow users to specify where the compiled assemblies will be placed.

Example Project

Source Pages

[[[SOURCE:http://www.someurl.com/ProjectPage1.htm]]] <-- not yet implemented
[[[SOURCE:http://www.someurl.com/ProjectPage2.htm]]] <-- not yet implemented

Project Blockanoidz

  • [[[PROJECTSTART:Blockanoidz:::EXE]]] <-- EXE=Windows app DLL=Library CON=Console app

Project file Main.vb

[[[FILESTART:Main.vb]]]

imports Microsoft.VisualBasic
imports System

public module General
    public sub Main()
         msgbox("Test") 'test code
        NewMethod()
    end sub
end module

[[[FILEEND:Main.vb]]]

Project file SecondFile.vb

[[[FILESTART:SubFolder\SecondFile.vb]]]

imports Microsoft.VisualBasic
imports System


public module SecondaryModule
    public sub NewMethod()
        msgbox("Cool Idea!") 
    end sub
end module

[[[FILEEND:SubFolder\SecondFile.vb]]]

Project file AssemblyInfo.vb

[[[FILESTART:AssemblyInfo.vb]]]

Imports System.Reflection
Imports System.Runtime.InteropServices
imports Microsoft.VisualBasic
imports System

' General Information about an assembly is controlled through the following 
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.

' Review the values of the assembly attributes

<Assembly: AssemblyTitle("")> 
<Assembly: AssemblyDescription("")> 
<Assembly: AssemblyCompany("")> 
<Assembly: AssemblyProduct("")> 
<Assembly: AssemblyCopyright("")> 
<Assembly: AssemblyTrademark("")> 
<Assembly: CLSCompliant(True)> 

'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("B0445D6B-96FB-4717-95BA-45F524449255")> 

' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version 
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Build and Revision Numbers 
' by using the '*' as shown below:

<Assembly: AssemblyVersion("1.0.*")> 

[[[FILEEND:AssemblyInfo.vb]]]

  • [[[PROJECTEND:Blockanoidz]]]

Projects that use the WikiCompiler

Future Additions

  • 1: Need to add support for SOURCE, ENTRYPOINT, EMBEDRESOURCE, CONTENT, ADDITIONALFILE, and BINFOLDER tags.
  • 2: Ability to compile C# code projects.
  • 3: Ability to down load and save a project.
  • 4: Ability to export a project out to a complete *.vbproj or *.csproj solution So it can be edited in VS.NET.
  • 5: Ability to merge projects with the same name from across multiple web page sources.