eclipse plugin: Force the xtext builder to skip the Wesnoth Core Library

This commit is contained in:
Timotei Dolean 2011-09-02 18:18:01 +00:00
parent 5d66cd0858
commit f8ec31942f
4 changed files with 46 additions and 3 deletions

View File

@ -8,11 +8,18 @@
*******************************************************************************/
package org.wesnoth;
import org.eclipse.xtext.resource.IResourceServiceProvider;
import org.wesnoth.builder.WMLResourceServiceProvider;
/**
* Use this class to register components to be used at runtime / without the
* Equinox extension registry.
*/
public class WMLRuntimeModule extends org.wesnoth.AbstractWMLRuntimeModule
public class WMLRuntimeModule extends AbstractWMLRuntimeModule
{
public Class< ? extends IResourceServiceProvider > bindIResourceServiceProvider( )
{
return WMLResourceServiceProvider.class;
}
}

View File

@ -0,0 +1,28 @@
/*******************************************************************************
* Copyright (c) 2011 by Timotei Dolean <timotei21@gmail.com>
*
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package org.wesnoth.builder;
import org.eclipse.emf.common.util.URI;
import org.eclipse.xtext.resource.impl.DefaultResourceServiceProvider;
import org.wesnoth.views.WesnothProjectsExplorer;
public class WMLResourceServiceProvider extends DefaultResourceServiceProvider
{
@Override
public boolean canHandle( URI uri )
{
if( uri.segmentCount( ) > 2
&& uri.segment( 2 ).equals(
WesnothProjectsExplorer.CORE_LIBRARY_NAME_ENCODED ) ) {
return false;
}
return super.canHandle( uri );
}
}

View File

@ -126,6 +126,8 @@ public class ProjectUtils
coreLibrary
.createLink( paths.getCoreDirPath( ), updateFlags,
new NullProgressMonitor( ) );
coreLibrary.setDerived( true, new NullProgressMonitor( ) );
} catch( CoreException e ) {
Logger.getInstance( ).logException( e );
return false;

View File

@ -29,13 +29,19 @@ public class WesnothProjectsExplorer extends CommonNavigator implements
/**
* The ID of the Wesnoth Projects Explorer
*/
public static final String ID_PROJECTS_EXPLORER = "org.wesnoth.views.WesnothProjectsExplorer"; //$NON-NLS-1$
public static final String ID_PROJECTS_EXPLORER = "org.wesnoth.views.WesnothProjectsExplorer"; //$NON-NLS-1$
/**
* The default name of the Wesnoth Core Library directory that exists
* in each Wesnoth Project
*/
public static final String CORE_LIBRARY_NAME = "Wesnoth Core Library";
public static final String CORE_LIBRARY_NAME = "Wesnoth Core Library";
/**
* The default name of the Wesnoth Core Library directory that exists
* in each Wesnoth Project encoded ( space = %20 )
*/
public static final String CORE_LIBRARY_NAME_ENCODED = "Wesnoth%20Core%20Library";
/**
* Creates a new {@link WesnothProjectsExplorer}