Grails

PATCH: OS X-specific build targets

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.0.2
  • Component/s: Project infrastructure
  • Labels:
    None
  • Environment:
    OS X only, JDK 1.4, 1.5 and 1.6
  • Patch Submitted:
    Yes

Description

Because the location of the JVM is standard on OS X machines, I want to add OS X-specific build targets to verify that Grails will build/test against a specific JVM version without having to fool around with:

export JAVA_HOME=/some/path/home

I have created an osx.xml ant build file with some OS X-specific build tasks:

osx-build-14
osx-build-15
etc.

These targets set JAVA_HOME to the specified version and execute ant clean build

osx-test-14
osx-test-15
etc.

These targets set JAVA_HOME to the specified version and execute ant clean build

osx-multi-build
osx-multi-test

These targets run a build/test on all JDK's > 1.4 if they are available . The target will fail if a build/test on any of the available JDKs fail.

  1. osxpatch.txt
    15/Mar/08 3:59 AM
    5 kB
    Drew Varner
  2. osxpatch2.txt
    18/Mar/08 12:50 PM
    5 kB
    Drew Varner

Activity

Hide
Graeme Rocher added a comment -

hmm the use of exec is a little problematic, for me i get permission denied errors

Show
Graeme Rocher added a comment - hmm the use of exec is a little problematic, for me i get permission denied errors
Hide
Drew Varner added a comment -

Are you getting them from an IDE or from the command line. I only run it from the Terminal.app. Here is what I see:

test-os:
     [echo] You are running Mac OS X i386 10.5.2

osx-multi-build:

osx-build-with-14:

build-with-jdk:
     [exec] Buildfile: build.xml
     [exec] 
     [exec] clean:
     [exec]      [echo] JAVA HOME IS /System/Library/Frameworks/JavaVM.framework/Versions/1.4/Home
     [exec] 
     [exec] build-init:
     [exec]     [mkdir] Created dir: /Users/varnerac/grails/target/classes
     [exec]     [mkdir] Created dir: /Users/varnerac/grails/target/test-classes
     [exec]     [mkdir] Created dir: /Users/varnerac/grails/target/test-reports
     [exec]     [mkdir] Created dir: /Users/varnerac/grails/dist
     [exec]     [mkdir] Created dir: /Users/varnerac/grails/target/stubs
     [exec] 
     [exec] build:
     [exec]      [copy] Copying 1 file to /Users/varnerac/grails/target/classes
     [exec]   [groovyc] Compiling 489 source files to /Users/varnerac/grails/target/classes
     ...
Show
Drew Varner added a comment - Are you getting them from an IDE or from the command line. I only run it from the Terminal.app. Here is what I see:
test-os:
     [echo] You are running Mac OS X i386 10.5.2

osx-multi-build:

osx-build-with-14:

build-with-jdk:
     [exec] Buildfile: build.xml
     [exec] 
     [exec] clean:
     [exec]      [echo] JAVA HOME IS /System/Library/Frameworks/JavaVM.framework/Versions/1.4/Home
     [exec] 
     [exec] build-init:
     [exec]     [mkdir] Created dir: /Users/varnerac/grails/target/classes
     [exec]     [mkdir] Created dir: /Users/varnerac/grails/target/test-classes
     [exec]     [mkdir] Created dir: /Users/varnerac/grails/target/test-reports
     [exec]     [mkdir] Created dir: /Users/varnerac/grails/dist
     [exec]     [mkdir] Created dir: /Users/varnerac/grails/target/stubs
     [exec] 
     [exec] build:
     [exec]      [copy] Copying 1 file to /Users/varnerac/grails/target/classes
     [exec]   [groovyc] Compiling 489 source files to /Users/varnerac/grails/target/classes
     ...
Hide
Drew Varner added a comment -

I believe I have found the issue. On my machine, grails/ant/bin/ant is executable by the user ("chmod u+x"). I build Grails with the Ant distro shipped with Grails.

So, I have modified the "build-with-jdk" and "test-with-jdk" to depend on a target ("make-ant-executable") that calls "chmod u+x ant/bin/ant" to make sure it can be executed.

Attaching the new patch, "osxpatch2.txt", now.

Show
Drew Varner added a comment - I believe I have found the issue. On my machine, grails/ant/bin/ant is executable by the user ("chmod u+x"). I build Grails with the Ant distro shipped with Grails. So, I have modified the "build-with-jdk" and "test-with-jdk" to depend on a target ("make-ant-executable") that calls "chmod u+x ant/bin/ant" to make sure it can be executed. Attaching the new patch, "osxpatch2.txt", now.
Hide
Drew Varner added a comment -

This patch fixes shortcoming in first patch. This one makes sure that grails/ant/bin/ant is executable.

Show
Drew Varner added a comment - This patch fixes shortcoming in first patch. This one makes sure that grails/ant/bin/ant is executable.
Hide
Drew Varner added a comment -

Also, it may be easier to set the permissions on ant/bin/ant to executable in the Subversion repository. I don't think I can create a patch that changes permissions. If you change the permissions, the first patch should work.

Show
Drew Varner added a comment - Also, it may be easier to set the permissions on ant/bin/ant to executable in the Subversion repository. I don't think I can create a patch that changes permissions. If you change the permissions, the first patch should work.
Hide
Graeme Rocher added a comment -

ok patch applied. thanks

Show
Graeme Rocher added a comment - ok patch applied. thanks

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: