<commit_before>package kaizen.plugins.nunit

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.util.ConfigureUtil
import kaizen.plugins.conventions.Configurations
import kaizen.plugins.assembly.tasks.AssemblyCompile
import org.gradle.api.Task

class NUnitAssemblyPlugin implements Plugin<Project> {

	@Override
	void apply(Project project) {
		def masterTestTask = project.task('test') {
			description 'Runs all nunit tests.'
		}
		def bundle = project.rootProject
		bundle.afterEvaluate {
			configureNUnitTasksOn project, masterTestTask
		}
	}

	void configureNUnitTasksOn(Project project, Task masterTestTask) {

		def rootProject = project.rootProject
		NUnitExtension nunit = rootProject.extensions.nunit
		def nunitVersion = nunit.version

		project.configurations.each { config ->
			def configLabel = Configurations.labelFor(config)
			AssemblyCompile compileTask = project.tasks.findByName("compile${configLabel}")
			if (compileTask) {
				project.dependencies.add(config.name, "nunit:nunit.framework:${nunitVersion}")
				configure(project) {
					def testConfigTask = task("test$configLabel", type: NUnitTask, dependsOn: compileTask) {
						dependsOn rootProject.tasks.updateNUnit
						inputs.file compileTask.assemblyFile
						outputs.file new File(compileTask.resolvedOutputDir, 'TestResult.xml')
					}
					masterTestTask.dependsOn(testConfigTask)
				}
			}
		}
	}

	def configure(Project project, Closure closure) {
		ConfigureUtil.configure(closure, project)
	}
}

<commit_msg>NUnitTask updated to latest AssemblyCompile api<commit_after>package kaizen.plugins.nunit

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.util.ConfigureUtil
import kaizen.plugins.conventions.Configurations
import kaizen.plugins.assembly.tasks.AssemblyCompile
import org.gradle.api.Task

class NUnitAssemblyPlugin implements Plugin<Project> {

	@Override
	void apply(Project project) {
		def masterTestTask = project.task('test') {
			description 'Runs all nunit tests.'
		}
		def bundle = project.rootProject
		bundle.afterEvaluate {
			configureNUnitTasksOn project, masterTestTask
		}
	}

	void configureNUnitTasksOn(Project project, Task masterTestTask) {

		def rootProject = project.rootProject
		NUnitExtension nunit = rootProject.extensions.nunit
		def nunitVersion = nunit.version

		project.afterEvaluate {
			project.configurations.each { config ->
				def configLabel = Configurations.labelFor(config)
				AssemblyCompile compileTask = project.tasks.findByName("compile${configLabel}")
				if (compileTask) {
					project.dependencies.add(config.name, "nunit:nunit.framework:${nunitVersion}")
					configure(project) {
						def outputAssembly = project.file(compileTask.outputAssembly)
						def testConfigTask = task("test$configLabel", type: NUnitTask, dependsOn: [compileTask, rootProject.tasks.updateNUnit]) {
							inputs.file outputAssembly
							outputs.file new File(outputAssembly.parentFile, 'TestResult.xml')
						}
						masterTestTask.dependsOn(testConfigTask)
					}
				}
			}
		}
	}

	def configure(Project project, Closure closure) {
		ConfigureUtil.configure(closure, project)
	}
}


{'fraction_non_alphanumeric': 0.09139615505830444, 'fraction_numerical': 0.0, 'mean_word_length': 4.667857142857143, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6442803', 'n_tokens_mistral': 1072, 'n_tokens_neox': 910, 'n_words': 182}