Re: Pure Scala webobjects app

David Avendasora <[email protected]> Fri, 12 Nov 2010 17:55:38 -0500
Newsgroups gmane.comp.web.webobjects.woproject.devel
Message-ID <[email protected]>
> On Nov 12, 2010, at 3:41 PM, John Huss wrote:
> 
>> I created a pure Scala WO app, and I have a couple small problems:
>> 
>> 1) The class files in "bin/" are not being copied to the into the "build/" folder by the WOLips incremental builder.  I'm not sure how this is supposed to work in general.  But "bin" is getting updated and "build" is not.  I have worked around it for now by changing the output path to "build/ScalaExample.woa/Contents/Resources/Java". but I don't know if that will always work.

Hi John,

I don't know anything about Scala, but as far as the incremental builder goes, you can create your own, along with a custom build.xml file that when it runs that can copy things to locations in different ways than what the standard incremental builder does. I had to do this to get a Java WebStart-based Java Client application to build correctly.

I know Chuck does something similar to get Eclipse to run tests and such automatically.

I'd say to go look at my instructions on the Wiki, but it appears that the confluence server is having problems.

Here's the basics (very D2JC-focused, but you should be able to take the concept and twist it to work for you): 

1) Create a new builder in your project properties (right-click on your project, select properties)


2) Point the builder at your new build.xml file (see attached for an example)


3) Set the refresh information:


4) Set the Targets (this is what tells Eclipse when to run your custom builder):




> 
> 2) When I right-click Application.scala I don't get the option to run it as a WOApplication.  I'm not sure where the option comes from.  I can create the launcher manually or run the java version first to create the launcher, but it would be nice to just have it work.

Can't help you with this one... sorry.

Good luck!

Dave
PastedGraphic-3.png (image/png, 82.7 KB) - not displayed
PastedGraphic-4.png (image/png, 103.8 KB) - not displayed
PastedGraphic-5.png (image/png, 95.8 KB) - not displayed
PastedGraphic-6.png (image/png, 96.2 KB) - not displayed
javaclientbuild.xml (application/xml, 2.3 KB)
<project name="javaclient" default="javaclient" basedir=".">
	<target name="init.properties">
		<property file="build.properties" />

		<property name="wolips.properties" value="${user.home}${file.separator}Library${file.separator}Application Support${file.separator}WOLips${file.separator}wolips.properties" />
		<property file="${wolips.properties}" />
		<condition property="wo.properties.check.failed">
			<not>
				<and>
					<isset property="wo.system.frameworks" />
					<isset property="wo.local.frameworks" />
				</and>
			</not>
		</condition>
		<fail message="The properties 'wo.system.frameworks' and 'wo.local.frameworks' must be set. Check that your ${wolips.properties} is correct." if="wo.properties.check.failed" />

		<property name="build.app.name" value="${project.name}" />
		<property name="build.app.name.lowercase" value="${project.name.lowercase}" />
	</target>

	<target name="javaclient" depends="init.properties">
		<mkdir dir="build/${project.name}.woa/Contents/WebServerResources/Java" />
		<!-- project client-side classes -->
		<copy todir="build/${project.name}.woa/Contents/WebServerResources/Java/">
			<fileset dir="${classes.dir}" includes="**/client/**/*.class,**/common/**/*.class" />
		</copy>
		<jar basedir="${classes.dir}" includes="**/client/**/*.class,**/common/**/*.class" jarfile="build/${project.name}.woa/Contents/WebServerResources/Java/${project.name}.jar">
		</jar>

		<!-- Launch Scripts and WOBootstrap.jar-->
		<mkdir dir="build/${project.name}.woa/Contents/MacOS" />
		<mkdir dir="build/${project.name}.woa/Contents/UNIX" />

		<chmod file="build/${project.name}.woa/Contents/${project.name}" perm="ugo+rx" />
		<copy file="${wo.local.root}/Library/Application Support/Apple/Developer Tools/WebObjects Support/WOBootstrap.jar" tofile="build/${project.name}.woa/Contents/WOBootstrap.jar" />

		<!-- Don't copy the script over. For some reason the client-side application cannot connect to the server-side when launched using the script. -->
		<copy file="UnixLaunchClient.sh" tofile="build/${project.name}.woa/Contents/MacOS/${project.name}_Client" />
		<chmod file="build/${project.name}.woa/Contents/MacOS/${project.name}_Client" perm="ugo+rx" />
		<copy file="ClasspathClient.txt" tofile="build/${project.name}.woa/Contents/MacOS/ClasspathClient.txt" />

	</target>
</project>