<commit_before>package com.ullink

import org.apache.commons.io.filefilter.DirectoryFileFilter
import org.gradle.api.GradleException
import org.gradle.util.VersionNumber

class XbuildResolver implements IExecutableResolver {
    XbuildResolver(){
        def execute = "mono --version".execute()
        execute.waitFor()
        if (execute.in.text == null)
            throw new GradleException("Mono must be on PATH.")
    }

    @Override
    ProcessBuilder executeDotNet(File exe) {
        return new ProcessBuilder("mono", exe.toString())
    }

    void setupExecutable(Msbuild msbuild) {
        msbuild.executable = 'xbuild.exe'
        msbuild.msbuildDir = getXBuildDir(msbuild)
    }

    public static String getXBuildDir(Msbuild msbuild) {
        if (msbuild.version != null)
            msbuild.logger.info("MSBuild version explicitly set to: '${msbuild.version}'")

        List<String> xbuildRoots = [getMonoBinaryRootDirectory()] + getOSXMonoRootDirectories()
        /*
            we can encounter the following scenario:
                /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/4.5
                /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild/14.0
                /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild/12.0
                /Library/Frameworks/Mono.framework/Versions/3.12.0/lib/mono/4.5
                /Library/Frameworks/Mono.framework/Versions/3.12.0/lib/mono/xbuild/12.0<commit_msg>Removed unnecessary check for mono in XbuildResolver constructor<commit_after>package com.ullink

import org.apache.commons.io.filefilter.DirectoryFileFilter
import org.gradle.api.GradleException
import org.gradle.util.VersionNumber

class XbuildResolver implements IExecutableResolver {
    
    @Override
    ProcessBuilder executeDotNet(File exe) {
        return new ProcessBuilder("mono", exe.toString())
    }

    void setupExecutable(Msbuild msbuild) {
        msbuild.executable = 'xbuild.exe'
        msbuild.msbuildDir = getXBuildDir(msbuild)
    }

    public static String getXBuildDir(Msbuild msbuild) {
        if (msbuild.version != null)
            msbuild.logger.info("MSBuild version explicitly set to: '${msbuild.version}'")

        List<String> xbuildRoots = [getMonoBinaryRootDirectory()] + getOSXMonoRootDirectories()
        /*
            we can encounter the following scenario:
                /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/4.5
                /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild/14.0
                /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild/12.0
                /Library/Frameworks/Mono.framework/Versions/3.12.0/lib/mono/4.5
                /Library/Frameworks/Mono.framework/Versions/3.12.0/lib/mono/xbuild/12.0
{'fraction_non_alphanumeric': 0.10849393290506781, 'fraction_numerical': 0.021413276231263382, 'mean_word_length': 2.7473262032085564, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5706524', 'n_tokens_mistral': 910, 'n_tokens_neox': 862, 'n_words': 134}