/*
 * Copyright 2020 the original author or authors.
 *
 * 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.
 */

package org.gradle.plugin.devel.internal.precompiled;

import groovy.lang.Script;
import org.gradle.api.internal.plugins.PluginManagerInternal;
import org.gradle.configuration.DefaultScriptTarget;
import org.gradle.groovy.scripts.BasicScript;
import org.gradle.groovy.scripts.DefaultScript;

class PrecompiledScriptTarget extends DefaultScriptTarget {

    private final boolean supportsPluginsBlock;
    private final boolean supportsPluginManagementBlock;

    PrecompiledScriptTarget(boolean supportsPluginsBlock, boolean supportsPluginManagementBlock) {
        super(null);
        this.supportsPluginsBlock = supportsPluginsBlock;
        this.supportsPluginManagementBlock = supportsPluginManagementBlock;
    }

    @Override
    public Class<? extends BasicScript> getScriptClass() {
        return DefaultScript.class;
    }

    @Override
    public boolean getSupportsPluginsBlock() {
        return supportsPluginsBlock;
    }

    @Override
    public boolean getSupportsPluginManagementBlock() {
        return supportsPluginManagementBlock;
    }

    @Override
    public void attachScript(Script script) {
        throw new UnsupportedOperationException();
    }

    @Override
    public PluginManagerInternal getPluginManager() {
        throw new UnsupportedOperationException();
    }

    @Override
    public void addConfiguration(Runnable runnable, boolean deferrable) {
        throw new UnsupportedOperationException();
    }
}

@@ -676,234 +676,51 @@
 ort 
-groovy.lang.Script;%0Aimport org.gradle.api.internal.plugins.PluginManagerInternal;%0Aimport org.gradle.configuration.DefaultScriptTarget;%0Aimport org.gradle.groovy.scripts.BasicScript;%0Aimport org.gradle.groovy.scripts.DefaultScrip
+org.gradle.configuration.DefaultScriptTarge
 t;%0A%0A
@@ -1151,124 +1151,8 @@
  %7D%0A%0A
-    @Override%0A    public Class%3C? extends BasicScript%3E getScriptClass() %7B%0A        return DefaultScript.class;%0A    %7D%0A%0A
     
@@ -1314,32 +1314,32 @@
 gementBlock() %7B%0A
+
         return s
@@ -1379,252 +1379,8 @@
  %7D%0A%0A
-    @Override%0A    public void attachScript(Script script) %7B%0A        throw new UnsupportedOperationException();%0A    %7D%0A%0A    @Override%0A    public PluginManagerInternal getPluginManager() %7B%0A        throw new UnsupportedOperationException();%0A    %7D%0A%0A
     

Remove unneeded overrides