blob: d9c1e3bc538e53ae08686ded342cc68b94cfa391 [file] [log] [blame]
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.gradle.tooling.provider.model.ToolingModelBuilderRegistry
@SuppressWarnings("GrPackage")
class JetGradlePlugin implements Plugin<Project> {
private final ToolingModelBuilderRegistry registry
@javax.inject.Inject
public JetGradlePlugin(ToolingModelBuilderRegistry registry) {
this.registry = registry
}
public void apply(Project project) {
registry.register(project.jetExtraModelBuilderClass.newInstance())
}
}
try {
String[] paths = ${EXTENSIONS_JARS_PATH}
URL[] urls = paths.collect{ new File(it).toURI().toURL() }
URLClassLoader classLoader = new URLClassLoader(urls, getClass().classLoader)
Class modelClass = classLoader.loadClass('org.jetbrains.plugins.gradle.tooling.internal.ExtraModelBuilder')
allprojects {
apply plugin: 'idea'
idea.module.ext.set('resourceDirs', [])
idea.module.ext.set('testResourceDirs', [])
ext.jetExtraModelBuilderClass = modelClass
apply plugin: JetGradlePlugin
}
}
catch (all) {
}