<commit_before>/*
 * Copyright 2014-2016 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 me.champeau.gradle;

import org.gradle.api.Project;
import org.gradle.api.file.DuplicatesStrategy;

import java.io.File;
import java.util.*;

import static org.codehaus.groovy.runtime.DefaultGroovyMethods.join;
import static org.codehaus.groovy.runtime.DefaultGroovyMethods.unique;

public class JMHPluginExtension {
    private final Project project;

    private String jmhVersion = "1.12";
    private boolean includeTests = true;

    private String include = "";
    private String exclude;
    private List<String> benchmarkMode;
    private Integer iterations;
    private Integer batchSize;
    private Integer fork;
    private Boolean failOnError;
    private Boolean forceGC;
    private String jvm;
    private String jvmArgs;
    private String jvmArgsAppend;
    private String jvmArgsPrepend;
    private File humanOutputFile;
    private File resultsFile;
    private Integer operationsPerInvocation;
    private Map benchmarkParameters;
    private List<String> profilers;
    private String timeOnIteration;
    private String resultExtension;
    private String resultFormat;
    private Boolean synchronizeIterations;
    private Integer threads;
    private List<Integer> threadGroups;
    private String timeUnit;
    private String verbosity;
    private String timeout;
    private String warmup;
    private Integer warmupBatchSize;
    private Integer warmupForks;
    private Integer warmupIterations;
    private String warmupMode;
    private List<String> warmupBenchmarks;
    private boolean zip64 = false;
    private DuplicatesStrategy duplicateClassesStrategy = DuplicatesStrategy.FAIL;

    public JMHPluginExtension(final Project project) {
        this.project = project;
    }

    public List<String> buildArgs() {
        resolveArgs();

        List<String> args = new ArrayList<String>();
        args.add(include);
        addOption(args, exclude, "e");
        addOption(args, iterations, "i");
        addOption(args, benchmarkModeCSV(), "bm");
        addOption(args, batchSize, "bs");
        addOption(args, fork, "f");
        addOption(args, failOnError, "foe");
        addOption(args, forceGC, "gc");
        addOption(args, jvm, "jvm");
        addOption(args, jvmArgs, "jvmArgs");
        addOption(args, jvmArgsAppend, "jvmArgsAppend");
        addOption(args, jvmArgsPrepend, "jvmArgsPrepend");
        addOption(args, humanOutputFile, "o");
        addOption(args, operationsPerInvocation, "opi");
        addOption(args, benchmarkParameters, "p");
        addOption(args, profilers, "prof", "-prof");
        addOption(args, resultsFile, "rff");
        addOption(args, timeOnIteration, "r");
        addOption(args, resultFormat, "rf");
        addOption(args, synchronizeIterations, "si");
        addOption(args, threads, "t");<commit_msg>Add spaces to '-prof' separator. Fixes #74<commit_after>/*
 * Copyright 2014-2016 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 me.champeau.gradle;

import org.gradle.api.Project;
import org.gradle.api.file.DuplicatesStrategy;

import java.io.File;
import java.util.*;

import static org.codehaus.groovy.runtime.DefaultGroovyMethods.join;
import static org.codehaus.groovy.runtime.DefaultGroovyMethods.unique;

public class JMHPluginExtension {
    private final Project project;

    private String jmhVersion = "1.12";
    private boolean includeTests = true;

    private String include = "";
    private String exclude;
    private List<String> benchmarkMode;
    private Integer iterations;
    private Integer batchSize;
    private Integer fork;
    private Boolean failOnError;
    private Boolean forceGC;
    private String jvm;
    private String jvmArgs;
    private String jvmArgsAppend;
    private String jvmArgsPrepend;
    private File humanOutputFile;
    private File resultsFile;
    private Integer operationsPerInvocation;
    private Map benchmarkParameters;
    private List<String> profilers;
    private String timeOnIteration;
    private String resultExtension;
    private String resultFormat;
    private Boolean synchronizeIterations;
    private Integer threads;
    private List<Integer> threadGroups;
    private String timeUnit;
    private String verbosity;
    private String timeout;
    private String warmup;
    private Integer warmupBatchSize;
    private Integer warmupForks;
    private Integer warmupIterations;
    private String warmupMode;
    private List<String> warmupBenchmarks;
    private boolean zip64 = false;
    private DuplicatesStrategy duplicateClassesStrategy = DuplicatesStrategy.FAIL;

    public JMHPluginExtension(final Project project) {
        this.project = project;
    }

    public List<String> buildArgs() {
        resolveArgs();

        List<String> args = new ArrayList<String>();
        args.add(include);
        addOption(args, exclude, "e");
        addOption(args, iterations, "i");
        addOption(args, benchmarkModeCSV(), "bm");
        addOption(args, batchSize, "bs");
        addOption(args, fork, "f");
        addOption(args, failOnError, "foe");
        addOption(args, forceGC, "gc");
        addOption(args, jvm, "jvm");
        addOption(args, jvmArgs, "jvmArgs");
        addOption(args, jvmArgsAppend, "jvmArgsAppend");
        addOption(args, jvmArgsPrepend, "jvmArgsPrepend");
        addOption(args, humanOutputFile, "o");
        addOption(args, operationsPerInvocation, "opi");
        addOption(args, benchmarkParameters, "p");
        addOption(args, profilers, "prof", " -prof ");
        addOption(args, resultsFile, "rff");
        addOption(args, timeOnIteration, "r");
        addOption(args, resultFormat, "rf");
        addOption(args, synchronizeIterations, "si");
        addOption(args, threads, "t");
{'fraction_non_alphanumeric': 0.08948966314876391, 'fraction_numerical': 0.005204568454532312, 'mean_word_length': 3.608927381745503, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '4624822', 'n_tokens_mistral': 1915, 'n_tokens_neox': 1844, 'n_words': 599}