Re: Build from source

From: Bob Schwarzmann (bo..chwarzmann.us)
Date: Fri Apr 14 2006 - 04:59:56 EDT

  • Next message: Anders Peterson: "Re: Use XCode or Use Eclipse and WOLips???"

    Hello,

    I do not have commit access, although I've fixed a few things through
    Sebastien's commit access. Again, this one got by me since I use the woproject
    on the command line. My original change was adding another XCode folder,
    WebServerResources. I felt it was a good idea to rename the current
    vars/methods from addFileXXX and addFolderXXX to addResourceFileXXX and
    addResourceFolderXXX. This would make it easier to distinguish between
    Resource and WebServerResource when generating an xcode project file.

    I might also suggest that since building wolips is required to check all
    dependencies, that ant return a build failure if wolips is not configured to
    build. I missed the friendly message about the eclipse.home variable for the 2
    months I've been modifying and building woproject.

    Someone, please commit on my behalf. I'm attaching the file and also the diff
    output below.

    Thanks,
    -Bob.

    Here is the fix:
    Index:
    wolips/plugins/org.objectstyle.wolips.builder/java/org/objectstyle/wolips/builder/internal/DotXcodeBuilder.java
    ===================================================================
    RCS file:
    /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips.builder/java/org/objectstyle/wolips/builder/internal/DotXcodeBuilder.java,v
    retrieving revision 1.9
    diff -r1.9 DotXcodeBuilder.java
    227c227
    < myXcodeProject.addFolderReference(resourcePath);

    ---
    >         myXcodeProject.addResourceFolderReference(resourcePath);
    230c230
    <         myXcodeProjProject.addFolderReference(resourcePath);
    ---
    >         myXcodeProjProject.addResourceFolderReference(resourcePath);
    235c235
    <       boolean addFileReference = true;
    ---
    >       boolean addResourceFileReference = true;
    239c239
    <           addFileReference = false;
    ---
    >           addResourceFileReference = false;
    242c242
    <       if (addFileReference) {
    ---
    >       if (addResourceFileReference) {
    244c244
    <           myXcodeProject.addFileReference(resourcePath);
    ---
    >           myXcodeProject.addResourceFileReference(resourcePath);
    247c247
    <           myXcodeProjProject.addFileReference(resourcePath);
    ---
    >           myXcodeProjProject.addResourceFileReference(resourcePath);
    

    --- Bob Schwarzmann <bo..chwarzmann.us> wrote:

    > I only run woproject from ant -- not the wolips plugin. So I never setup > that > little variable called eclipse.home which controls building wolips. I'm > going > to get that going and fix the problem. > > Sorry for the build break. > -Bob. > > --- S�bastien Sahuc <lis..ahuc.net> wrote: > > > Sounds like I committed too fast a change there. Let me cross check > > and fix that now. > > > > Sebastien > > > > On Apr 12, 2006, at 1:09 PM, Mike Schrag wrote: > > > > > This does appear to be a legit build failure ... Did someone happen > > > to remove addFileReference? It doesn't appear to exist in the type > > > hierarchy anymore. > > > > > > ms > > > > > > On Apr 12, 2006, at 12:08 PM, Anders Peterson wrote: > > > > > >> Well... that's what I do ...but I didn't say which version of > > >> eclipse I was using - it was 3.1.2 ;-) > > >> > > >> I've just spent several hours trying to upgrade to 3.2M6 and all > > >> the required dependencies, but can't get it to work. > > >> > > >> BTW. The last nightly build failed: > > >> http://www.mdimension.com/~wolips/build.log > > >> > > >> I've switched back to eclipse 3.1.2. Is it possible to get a > > >> version of WOLips that works with that? > > >> > > >> /Anders > > >> > > >> Bob Schwarzmann wrote: > > >>> Anders, > > >>> Are you building from a command line or from within an IDE (your > > >>> path would > > >>> indicate eclipse)? > > >>> I build from the command line, on 10.4.6 with: > > >>> Java(TM) 2 Runtime Environment, Standard Edition (build > > >>> 1.4.2_09-232) > > >>> Apache Ant version 1.6.2 compiled on March 20 2005 > > >>> cd into the projects directory and run: ant > > >>> All output goes into the temp directory. > > >>> I did an update just this morning after Sebastien committed a fix > > >>> I submitted. Everything built successfully. > > >>> Hope that helps, > > >>> -Bob. > > >>> --- Anders Peterson <anders_peterso..ptimatika.se> wrote: > > >>>> Hi All, > > >>>> > > >>>> I just tried to build from source (CVS HEAD) and it failed. I > > >>>> haven't done this in a very long time. Is there something I need > > >>>> to know? > > >>>> > > >>>> I'm using Mas OS X 10.4.6, Java 1.5.0_05 and Ant 1.6.2 > > >>>> > > >>>> /Anders > > >>>> > > >>>> java: > > >>>> [javac] Compiling 13 source files to /Users/apete/Developer/ > > >>>> eclipse3_ws/WOProject/temp/classes > > >>>> [javac] > > >>> /Users/apete/Developer/eclipse3_ws/WOProject/wolips/plugins/ > > >>> org.objectstyle.wolips.launching/java/org/objectstyle/wolips/ > > >>> launching/actions/WOJavaApplicationLaunchShortcut.java:94: > > >>>> cannot find symbol > > >>>> [javac] symbol : method reportErorr > > >>>> (org.eclipse.core.runtime.CoreException) > > >>>> [javac] location: class > > >>>> org.objectstyle.wolips.launching.actions.WOJavaApplicationLaunchSho > > >>>> rtcut > > >>>> [javac] reportErorr(exception); > > >>>> [javac] ^ > > >>>> [javac] > > >>> /Users/apete/Developer/eclipse3_ws/WOProject/wolips/plugins/ > > >>> org.objectstyle.wolips.launching/java/org/objectstyle/wolips/ > > >>> launching/actions/WOJavaApplicationLaunchShortcut.java:104: > > >>>> cannot find symbol > > >>>> [javac] symbol : method reportErorr > > >>>> (org.eclipse.core.runtime.CoreException) > > >>>> [javac] location: class > > >>>> org.objectstyle.wolips.launching.actions.WOJavaApplicationLaunchSho > > >>>> rtcut > > >>>> [javac] reportErorr(exception); > > >>>> [javac] ^ > > >>>> [javac] > > >>> /Users/apete/Developer/eclipse3_ws/WOProject/wolips/plugins/ > > >>> org.objectstyle.wolips.launching/java/org/objectstyle/wolips/ > > >>> launching/ui/AbstractWOArgumentsTab.java:334: > > >>>> warning: [deprecation] launched(org.eclipse.debug.core.ILaunch) > > >>>> in org.eclipse.debug.ui.ILaunchConfigurationTab has been deprecated > > >>>> [javac] public void launched(ILaunch launch) { > > >>>> [javac] ^ > > >>>> [javac] > > >>> /Users/apete/Developer/eclipse3_ws/WOProject/wolips/plugins/ > > >>> org.objectstyle.wolips.launching/java/org/objectstyle/wolips/ > > >>> launching/ui/BrowserTab.java:20: > > >>>> warning: [deprecation] launched(org.eclipse.debug.core.ILaunch) > > >>>> in org.eclipse.debug.ui.ILaunchConfigurationTab has been deprecated > > >>>> [javac] public class BrowserTab extends > > >>>> AbstractWOArgumentsTab { > > >>>> [javac] ^ > > >>>> [javac] > > >>> /Users/apete/Developer/eclipse3_ws/WOProject/wolips/plugins/ > > >>> org.objectstyle.wolips.launching/java/org/objectstyle/wolips/ > > >>> launching/ui/CommonWOArgumentsTab.java:101: > > >>>> warning: [deprecation] launched(org.eclipse.debug.core.ILaunch) > > >>>> in org.eclipse.debug.ui.ILaunchConfigurationTab has been deprecated > > >>>> [javac] public class CommonWOArgumentsTab extends > > >>>> AbstractWOArgumentsTab { > > >>>> [javac] ^ > > >>>> [javac] > > >>> /Users/apete/Developer/eclipse3_ws/WOProject/wolips/plugins/ > > >>> org.objectstyle.wolips.launching/java/org/objectstyle/wolips/ > > >>> launching/ui/LogTab.java:87: > > >>>> warning: [deprecation] launched(org.eclipse.debug.core.ILaunch) > > >>>> in org.eclipse.debug.ui.ILaunchConfigurationTab has been deprecated > > >>>> [javac] public class LogTab extends AbstractWOArgumentsTab { > > >>>> [javac] ^ > > >>>> [javac] 2 errors > > >>>> [javac] 4 warnings > > >>>> > > >>>> BUILD FAILED > > >>>> /Users/apete/Developer/eclipse3_ws/WOProject/build.xml:110: The > > >>>> following error occurred while executing this line: > > >>>> /Users/apete/Developer/eclipse3_ws/WOProject/wolips/build.xml: > > >>>> 34: The following error occurred while executing this line: > > >>>> /Users/apete/Developer/eclipse3_ws/WOProject/wolips/plugins/ > > >>>> build.xml:107: The following error occurred while executing this > > >>>> line: > > >>>> > > >>> /Users/apete/Developer/eclipse3_ws/WOProject/wolips/plugins/ > > >>> org.objectstyle.wolips.launching/build.xml:24: > > >>>> The following error occurred while executing this line: > > >>>> > > >>> /Users/apete/Developer/eclipse3_ws/WOProject/buildscripts/plugin- > > >>> project.xml:25: > > >>>> Compile failed; see the compiler error output for details. > > >>>> > > >> > > >> > > >> -- > > >> http://ojalgo.org/ > > >> > > >> Mathematics, Linear Algebra and Optimisation with Java > > > > > > > > >

    /* ==================================================================== * * The ObjectStyle Group Software License, Version 1.0 * * Copyright (c) 2005 The ObjectStyle Group, * and individual authors of the software. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * ObjectStyle Group (http://objectstyle.org/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "ObjectStyle Group" and "Cayenne" * must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact andru..bjectstyle.org. * * 5. Products derived from this software may not be called "ObjectStyle" * nor may "ObjectStyle" appear in their names without prior written * permission of the ObjectStyle Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the ObjectStyle Group. For more * information on the ObjectStyle Group, please see * <http://objectstyle.org/>. * */ package org.objectstyle.wolips.builder.internal;

    import java.util.Iterator; import java.util.List; import java.util.Map;

    import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResourceDelta; import org.eclipse.core.resources.IncrementalProjectBuilder; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.JavaCore; import org.objectstyle.woenvironment.pb.PBXProject; import org.objectstyle.woenvironment.pb.XcodeProjProject; import org.objectstyle.woenvironment.pb.XcodeProject; import org.objectstyle.wolips.builder.BuilderPlugin; import org.objectstyle.wolips.core.resources.builder.ICleanBuilder; import org.objectstyle.wolips.core.resources.builder.IDeltaBuilder; import org.objectstyle.wolips.core.resources.types.project.IProjectAdapter; import org.objectstyle.wolips.preferences.Preferences;

    /** *..uthor mschrag */ public class DotXcodeBuilder implements IDeltaBuilder, ICleanBuilder { private XcodeProject myXcodeProject; private XcodeProjProject myXcodeProjProject;

    public DotXcodeBuilder() { }

    public boolean buildStarted(int _kind, Map _args, IProgressMonitor _monitor, IProject _project, Map _buildCache) { boolean fullRebuild = false; if (Preferences.getPREF_WRITE_XCODE_ON_BUILD()) { myXcodeProject = new XcodeProject(); fullRebuild = !_project.getFolder(_project.getName() + ".xcode").getFile("project.pbxproj").exists(); } else { myXcodeProject = null; }

    if (Preferences.getPREF_WRITE_XCODE21_ON_BUILD()) { myXcodeProjProject = new XcodeProjProject(); fullRebuild = !_project.getFolder(_project.getName() + ".xcodeproj").getFile("project.pbxproj").exists(); } else { myXcodeProjProject = null; } return fullRebuild; }

    public boolean buildPreparationDone(int _kind, Map _args, IProgressMonitor _monitor, IProject _project, Map _buildCache) { if (_kind == IncrementalProjectBuilder.FULL_BUILD || _kind == IncrementalProjectBuilder.CLEAN_BUILD) { if (myXcodeProject != null) { try { writeXcodeProject(_monitor, _project, myXcodeProject, _project.getName() + ".xcode"); } catch (CoreException e) { BuilderPlugin.getDefault().log(e); } }

    if (myXcodeProjProject != null) { try { writeXcodeProject(_monitor, _project, myXcodeProjProject, _project.getName() + ".xcodeproj"); } catch (CoreException e) { BuilderPlugin.getDefault().log(e); } } } return false; }

    protected void writeXcodeProject(IProgressMonitor _monitor, IProject _project, PBXProject _xcodeProject, String _projectFolderName) throws CoreException { IProjectAdapter projectAdapter = (IProjectAdapter) _project.getAdapter(IProjectAdapter.class); List frameworkPaths = projectAdapter.getFrameworkPaths(); Iterator frameworkPathsIter = frameworkPaths.iterator(); while (frameworkPathsIter.hasNext()) { IPath frameworkPath = (IPath) frameworkPathsIter.next(); IContainer frameworkContainer = ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(frameworkPath); if (frameworkContainer instanceof IProject) { IProject frameworkProject = (IProject) frameworkContainer; IJavaProject frameworkJavaProject = JavaCore.create(frameworkProject); if (frameworkJavaProject != null) { IPath defaultOutputLocation = frameworkProject.getLocation().append("build"); if (defaultOutputLocation != null) { IPath builtFrameworkPath = defaultOutputLocation.append(frameworkProject.getName() + ".framework"); _xcodeProject.addFrameworkReference(builtFrameworkPath.toOSString()); } } } else { _xcodeProject.addFrameworkReference(frameworkPath.toOSString()); } }

    IFile projectFolderFile = _project.getFile(_projectFolderName); if (projectFolderFile.exists()) { // NTS: ?? BuilderPlugin.getDefault().log("Specified Xcode project package (" + _projectFolderName + ") is not a directory."); } else { IFolder projectFolder = _project.getFolder(_projectFolderName); if (!projectFolder.exists()) { projectFolder.create(false, true, _monitor); } IFile pbxProjFile = projectFolder.getFile("project.pbxproj"); _xcodeProject.save(pbxProjFile.getLocation().toFile()); pbxProjFile.refreshLocal(IResource.DEPTH_INFINITE, _monitor); } }

    public boolean handleSourceDelta(IResourceDelta _delta, IProgressMonitor monitor, Map _buildCache) { return _delta.getKind() == IResourceDelta.ADDED || _delta.getKind() == IResourceDelta.REMOVED; }

    public boolean handleClassesDelta(IResourceDelta _delta, IProgressMonitor monitor, Map _buildCache) { return _delta.getKind() == IResourceDelta.ADDED || _delta.getKind() == IResourceDelta.REMOVED; }

    public boolean handleWoappResourcesDelta(IResourceDelta _delta, IProgressMonitor monitor, Map _buildCache) { return _delta.getKind() == IResourceDelta.ADDED || _delta.getKind() == IResourceDelta.REMOVED; }

    public boolean handleWebServerResourcesDelta(IResourceDelta _delta, IProgressMonitor monitor, Map _buildCache) { return _delta.getKind() == IResourceDelta.ADDED || _delta.getKind() == IResourceDelta.REMOVED; }

    public boolean handleOtherDelta(IResourceDelta _delta, IProgressMonitor monitor, Map _buildCache) { return false; }

    public boolean classpathChanged(IResourceDelta _delta, IProgressMonitor monitor, Map _buildCache) { return false; }

    public void handleSource(IResource _resource, IProgressMonitor _progressMonitor, Map _buildCache) { if (myXcodeProject != null) { myXcodeProject.addSourceReference(_resource.getLocation().toOSString()); } if (myXcodeProjProject != null) { myXcodeProjProject.addSourceReference(_resource.getLocation().toOSString()); } }

    public void handleClasses(IResource _resource, IProgressMonitor _progressMonitor, Map _buildCache) { }

    public void handleClasspath(IResource _resource, IProgressMonitor _progressMonitor, Map _buildCache) { }

    public void handleOther(IResource _resource, IProgressMonitor _progressMonitor, Map _buildCache) { }

    public void handleWebServerResources(IResource _resource, IProgressMonitor _progressMonitor, Map _buildCache) { // NTS: Do something here? }

    public void handleWoappResources(IResource _resource, IProgressMonitor _progressMonitor, Map _buildCache) { String resourcePath = _resource.getLocation().toOSString(); //System.out.println("DotXcodeBuilder.handleWoappResources: " + resourcePath + ", " + (_resource instanceof IFolder)); if (_resource instanceof IFolder) { if (myXcodeProject != null) { myXcodeProject.addResourceFolderReference(resourcePath); } if (myXcodeProjProject != null) { myXcodeProjProject.addResourceFolderReference(resourcePath); } } else if (_resource instanceof IFile) { IContainer parent = _resource.getParent(); boolean addResourceFileReference = true; if (parent != null) { String parentName = parent.getName().toLowerCase(); if (parentName.endsWith(".eomodeld") || parentName.endsWith(".wo")) { addResourceFileReference = false; } } if (addResourceFileReference) { if (myXcodeProject != null) { myXcodeProject.addResourceFileReference(resourcePath); } if (myXcodeProjProject != null) { myXcodeProjProject.addResourceFileReference(resourcePath); } } } } }



    This archive was generated by hypermail 2.0.0 : Fri Apr 14 2006 - 04:59:59 EDT