<commit_before>/*
 * Copyright 2007-2008 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.api.plugins.osgi;

import org.gradle.api.tasks.bundling.GradleManifest;

import java.util.jar.Manifest;
import java.util.List;
import java.util.Map;
import java.io.File;

/**
 * @author <NAME>
 */
public interface OsgiManifest {
    Manifest generateManifest();

    List<String> instructionValue(String instructionName);

    OsgiManifest instruction(String name, String... values);

    OsgiManifest instructionFirst(String name, String... values);

    Map<String, List<String>> getInstructions();

    String getSymbolicName();

    void setSymbolicName(String symbolicName);

    String getName();

    void setName(String name);

    String getVersion();

    void setVersion(String version);

    String getDescription();

    void setDescription(String description);

    String getLicense();

    void setLicense(String license);

    String getVendor();

    void setVendor(String vendor);

    String getDocURL();

    void setDocURL(String docURL);

    File getClassesDir();

    void setClassesDir(File classesDir);

    OsgiManifest overwrite(GradleManifest manifest);

    List<File> getClasspath();

    void setClasspath(List<File> classpath);

    /**
     * Returns the classpath types.
     *
     * @see #setClasspathTypes(java.util.List)
     */
    List<String> getClasspathTypes();

    /**
     * Set the dependency types to be taken into account when generating the osgi manifest.
     * Sometimes people add for some reasons archive types like tar.gz to the compile or runtime configuration. OSGi can't cope
     * with such dependencies and throws and exception. By default classpathTypes include 'zip' and 'jar'.
     */
    void setClasspathTypes(List<String> types);
}<commit_msg>Added Javadoc<commit_after>/*
 * Copyright 2007-2008 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.api.plugins.osgi;

import org.gradle.api.tasks.bundling.GradleManifest;

import java.io.File;
import java.util.List;
import java.util.Map;
import java.util.jar.Manifest;

/**
 * @author <NAME>
 */
public interface OsgiManifest {
    Manifest generateManifest();

    /**
     * Returns the list of arguments for a particular instruction.
     *
     * @param instructionName
     * @return The list of arguments
     * @see #instruction(String, String[])
     */
    List<String> instructionValue(String instructionName);

    /**
     * Adds arguments to an instruction. If the instruction does not exists, it is created. If it does exists, the
     * arguments are appended to the existing arguments.
     * 
     * @param name
     * @param values
     * @return this
     * @see #instructionFirst(String, String[])
     */
    OsgiManifest instruction(String name, String... values);

    /**
     * Adds arguments to an instruction. If the instruction does not exists, it is created. If it does exists, the
     * arguments are inserted before the existing arguments.
     *
     * @param name
     * @param values
     * @return this
     * @see #instructionFirst(String, String[])
     */
    OsgiManifest instructionFirst(String name, String... values);

    /**
     * Returns all exisiting instruction.
     *
     * @return A map with instructions. The key of the map is the instruction name, the value a list of arguments.
     */
    Map<String, List<String>> getInstructions();

    /**
     * Returns the symbolic name.
     *
     * @see #setSymbolicName(String) 
     */
    String getSymbolicName();

    /**
     * A convenient method for setting a Bundle-SymbolicName instruction.
     *
     * @param symbolicName the symbolicName to set
     */
    void setSymbolicName(String symbolicName);

    /**
     * Returns the name
     *
     * @see #setName(String)
     */
    String getName();

    /**
     * A convenient method for setting a Bundle-Name instruction.
     *
     * @param name the name to set
     */
    void setName(String name);

    /**
     * Returns the version
     *
     * @see #setVersion(String) 
     */
    String getVersion();

    /**
     * A convenient method for setting a Bundle-Version instruction.
     *
     * @param version the version to set
     */
    void setVersion(String version);

    /**
     * Returns the description.
     *
     * @see #setDescription(String) 
     */
    String getDescription();

    /**
     * A convenient method for setting a Bundle-Description instruction.
     *
     * @param description the description to set
     */
    void setDescription(String description);

    /**
     * Returns the license
     * @see #setLicense(String) 
     */
    String getLicense();

    /**
     * A convenient method for setting a Bundle-License instruction.
     *
     * @param license The license to set
     */
    void setLicense(String license);

    /**
     * Returns the vendor.
     *
     * @see #setVendor(String) 
     */
    String getVendor();

    /**
     * A convenient method for setting a Bundle-Vendor instruction.
     *
     * @param vendor The vendor to set
     */
    void setVendor(String vendor);

    /**
     * Returns the docURL value.
     *
     * @see #setDocURL(String)
     */
    String getDocURL();

    /**
     * A convenient method for setting a Bundle-DocURL instruction.
     *
     * @param docURL the docURL to set.
     */
    void setDocURL(String docURL);

    /**
     * Returns the classes dir.
     *
     * @see #setClassesDir(java.io.File) 
     */
    File getClassesDir();

    /**
     * Sets the classes dir. This directory is the major source of input for generation the OSGi manifest. All classes
     * are analyzed for its packages and package dependencies. Based on this the Import-Package value is set.
     * This auto generated value can be overwritten by explicitly setting an instruction.
     *
     * @param classesDir
     * 
     * @see #instruction(String, String[])
     */
    void setClassesDir(File classesDir);

    /**
     * Generated and writes the OSGi manifest information into a GradleManifest. Existing information in the GradleManifest
     * is removed.
     *
     * @param manifest The GradleManifest to write into.
     * @return this
     */
    OsgiManifest overwrite(GradleManifest manifest);

    /**
     * Returns the classpath.
     *
     * @see #setClasspath(java.util.List) 
     */
    List<File> getClasspath();

    /**
     * A convenient method for setting a Bundle-Classpath instruction. The information of the classpath elements are only used if they are OSGi bundles. In this
     * case for example the version information provided by the bundle is used in the Import-Package of the generated
     * OSGi bundle.
     *
     * @param classpath The classpath elements
     */
    void setClasspath(List<File> classpath);

    /**
     * Returns the classpath types.
     *
     * @see #setClasspathTypes(java.util.List)
     */
    List<String> getClasspathTypes();

    /**
     * Set the dependency types to be taken into account when generating the osgi manifest.
     * Sometimes people add for some reasons archive types like tar.gz to the compile or runtime configuration. OSGi can't cope
     * with such dependencies and throws and exception. By default classpathTypes include 'zip' and 'jar'.
     */
    void setClasspathTypes(List<String> types);
}
{'fraction_non_alphanumeric': 0.09065189201933278, 'fraction_numerical': 0.0028291877873393846, 'mean_word_length': 2.719421306444542, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3521123', 'n_tokens_mistral': 2330, 'n_tokens_neox': 2233, 'n_words': 841}