mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-04 19:25:29 +00:00
eclipse plugin: Force the xtext builder to skip the Wesnoth Core Library
This commit is contained in:
parent
5d66cd0858
commit
f8ec31942f
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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 );
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
@ -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}
|
||||
|
Loading…
x
Reference in New Issue
Block a user