Skip to content

Commit

Permalink
Added the ability to fetch repository-logs at runtime.
Browse files Browse the repository at this point in the history
Using runrepositoryfetch.bat, the user is now able to start codeswarm alternatively with a swing-frame. 

This frame asks the user for a repository location, a username and a password for the repository.
It is able to connect to any svn-repository, since it uses svnkit to fetch the repository-log.
The repository-log gets fetched and converted to the xml-format, codeswarm expects as input.
The xml-file is cached until the latestRevision of the remote repository changes.
See javadoc for detailed information.

git-svn-id: http://codeswarm.googlecode.com/svn/trunk@235 eda9c206-d64f-0410-a2f2-67f3fa0499ed
  • Loading branch information
kraeusen committed Aug 7, 2008
1 parent fb9feea commit 5d0452a
Show file tree
Hide file tree
Showing 15 changed files with 1,173 additions and 5 deletions.
15 changes: 12 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,17 @@
<target name="build" depends="init" description="Compiles">
<echo>Running BUILD</echo>
<mkdir dir="${build}" />
<javac destdir="${build}" srcdir="${src}"
classpath="${lib}/core.jar;${lib}/xml.jar;${lib}/jogl.jar;${lib}/opengl.jar;${lib}/vecmath.jar" debug="true" deprecation="false" />
<path id="library.classpath">
<pathelement path="lib/" />
<pathelement location="lib/core.jar" />
<pathelement location="lib/xml.jar" />
<pathelement location="lib/jogl.jar" />
<pathelement location="lib/opengl.jar" />
<pathelement location="lib/vecmath.jar" />
<pathelement location="lib/svnkit.jar" />
<pathelement location="lib/swing-layout-1.0.3.jar" />
</path>
<javac destdir="${build}" srcdir="${src}" classpathref="library.classpath" debug="true" deprecation="false" />
<copy file="${src}/particle.png" todir="${build}" />
</target>

Expand All @@ -43,7 +52,7 @@ classpath="${lib}/core.jar;${lib}/xml.jar;${lib}/jogl.jar;${lib}/opengl.jar;${li

<target name="run" depends="jar" description="Runs the program">
<echo>Running code_swarm</echo>
<java classname="code_swarm" fork="true">
<java classname="MainView" fork="true">
<jvmarg value="-Xmx1000m" />
<arg value="data/sample.config"/>
<classpath>
Expand Down
5 changes: 5 additions & 0 deletions data/log.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#see http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/LogManager.html
.level=SEVERE
org.codeswarm.level=FINEST
handlers=java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level = ALL
Binary file added lib/svnkit.jar
Binary file not shown.
Binary file added lib/swing-layout-1.0.3.jar
Binary file not shown.
43 changes: 43 additions & 0 deletions runrepositoryfetch.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@ECHO OFF
REM run.bat : code_swarm launching script
REM need the config file as first parameter

REM TODO : take care of multiple parameters
SET params="%1"
set default_config="data/sample.config"

REM basic command line parameters check
IF %params%=="" (
REM asking user for a config file
ECHO Specify a config file, or type
SET /p params="ENTER for default one [%default_config%] : "
)
IF %params%=="" (
SET params=%default_config%
)

REM help requested ?
IF "%1"=="/?" goto help
IF "%1"=="/H" goto help
IF "%1"=="-h" goto help
IF "%1"=="--help" goto help
goto binaryCheck
:help
REM if help needed, print it and exit
echo usage: run configfile
echo data/sample.config is the default config file"
exit

:binaryCheck
REM checking for code_swarm java binaries
IF NOT EXIST dist\code_swarm.jar (
echo no code_swarm binaries !
echo needing to build it with 'ant' and 'javac' java-sdk
echo auto-trying the ant command...
call ant
)

REM running
REM echo %params%
echo code_swarm project !
java -Xmx1000m -classpath dist/code_swarm.jar;lib/core.jar;lib/xml.jar;lib/vecmath.jar;lib/svnkit.jar;lib/swing-layout-1.0.3.jar;. MainView %params%
13 changes: 12 additions & 1 deletion src/CodeSwarmConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public CodeSwarmConfig(String configFileName) throws IOException
p = new Properties( this.createDefaults() );
p.load( new FileInputStream(configFileName) );
}

private Properties createDefaults()
{
Properties def = new Properties();
Expand Down Expand Up @@ -154,6 +154,17 @@ public Color getBackground()
return _background;
}

/**
* Specify the path to the Xml-input file containing the repository
* entries.<br />
* Further versions should not use input-file but an abstract view
* of the repository-entries.
* @see EventList
* @param filePath the path to the Xml-input file.
*/
public void setInputFile(String filePath){
p.setProperty(INPUT_FILE_KEY, filePath);
}
/**
*
* @param key
Expand Down
117 changes: 117 additions & 0 deletions src/MainView.form
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8" ?>

<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
</SyntheticProperties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>

<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="userName" pref="305" max="32767" attributes="0"/>
<Component id="repositoryURL" alignment="0" pref="305" max="32767" attributes="0"/>
<Component id="password" alignment="0" pref="305" max="32767" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="clearCache" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="242" max="32767" attributes="0"/>
<Component id="goButton" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="repositoryURL" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="userName" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="password" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="goButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="clearCache" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="RepositoryURL"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="Username"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="text" type="java.lang.String" value="Password"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="repositoryURL">
</Component>
<Component class="javax.swing.JTextField" name="userName">
</Component>
<Component class="javax.swing.JPasswordField" name="password">
</Component>
<Component class="javax.swing.JButton" name="goButton">
<Properties>
<Property name="text" type="java.lang.String" value="GO"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="goButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="clearCache">
<Properties>
<Property name="text" type="java.lang.String" value="Clear Cache"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="clearCacheActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
Loading

0 comments on commit 5d0452a

Please sign in to comment.