<commit_before>package com.padma.tool.gradle.plugin

import com.padma.buildtool.osgi.manifest.Instructions
import com.padma.buildtool.osgi.manifest.ManifestBuilder
import org.gradle.api.Plugin
import org.gradle.api.internal.project.ProjectInternal
import org.gradle.api.plugins.JavaPlugin
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.bundling.Jar

import java.nio.file.Path

import static java.nio.file.Files.exists
import static java.nio.file.Paths.get

/**
 * Created on 5/9/16.
 */
class BundlePlugin implements Plugin<ProjectInternal>
{
    @Override
    void apply(final ProjectInternal project)
    {
        project.plugins.apply(JavaPlugin)
        project.plugins.withType(JavaPlugin) {
            def main = project.convention.getPlugin(JavaPluginConvention).sourceSets.main

            Path root = get(main.output.classesDir.toURI())
            def builder = new ManifestBuilder(root)

            // configure customized headers.
            def props = ['Bundle-SymbolicName': "${project.name}", 'Bundle-Version': "${project.version.toString()}", 'Bundle-Name': "${project.name}"]
            builder.withProps(props)

            // configure customized instructions.
            main.resources.srcDirs.each { dir ->
                def manifestPath = get(dir.toURI()).resolve('META-INF/manifest.yml')
                if (exists(manifestPath))
                {
                    def instructions = Instructions.fromYml(manifestPath.toUri().toURL())
                    builder.with(instructions)
                }
            }

            project.tasks.withType(Jar) {
                it.setManifest(new BundleManifest(project.fileResolver, builder))
            }
        }
    }
}<commit_msg>use String instead of GString.<commit_after>package com.padma.tool.gradle.plugin

import com.padma.buildtool.osgi.manifest.Instructions
import com.padma.buildtool.osgi.manifest.ManifestBuilder
import org.gradle.api.Plugin
import org.gradle.api.internal.project.ProjectInternal
import org.gradle.api.plugins.JavaPlugin
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.bundling.Jar

import java.nio.file.Path

import static java.nio.file.Files.exists
import static java.nio.file.Paths.get


/**
 * Created on 5/9/16.*/
class BundlePlugin implements Plugin<ProjectInternal>
{
	@Override
	void apply(final ProjectInternal project)
	{
		project.plugins.apply(JavaPlugin)
		project.plugins.withType(JavaPlugin) {
			def main = project.convention.getPlugin(JavaPluginConvention).sourceSets.main

			Path root = get(main.output.classesDir.toURI())
			def builder = new ManifestBuilder(root)

			// configure customized headers.
			def props = ["Bundle-SymbolicName": project.name, "Bundle-Version": project.version.
					toString(), "Bundle-Name"   : project.name] as Map
			builder.withProps(props)

			// configure customized instructions.
			main.resources.srcDirs.each {dir ->
				def manifestPath = get(dir.toURI()).resolve('META-INF/manifest.yml')
				if (exists(manifestPath))
				{
					def instructions = Instructions.fromYml(manifestPath.toUri().toURL())
					builder.with(instructions)
				}
			}

			project.tasks.withType(Jar) {
				it.setManifest(new BundleManifest(project.fileResolver, builder))
			}
		}
	}
}
{'fraction_non_alphanumeric': 0.1140430694570822, 'fraction_numerical': 0.002426448286320898, 'mean_word_length': 3.185279187817259, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2279387', 'n_tokens_mistral': 1042, 'n_tokens_neox': 940, 'n_words': 163}