<commit_before><!--

    Copyright (C) 2013-2016 <NAME>, and others

    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.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.thriftee</groupId>
    <artifactId>thriftee-root</artifactId>
    <version>0.3-SNAPSHOT</version>
  </parent>

  <artifactId>thriftee-xml-protocol</artifactId>
  <name>thriftee-xml-protocol</name>

  <dependencies>
    <dependency>
      <groupId>org.apache.thrift</groupId>
      <artifactId>libthrift</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
    </dependency>
    <dependency>
    <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.thriftee</groupId>
      <artifactId>thriftee-provider-swift</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>net.sf.saxon</groupId>
      <artifactId>Saxon-HE</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <properties>
    <thrift.command>thrift</thrift.command>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.gmaven</groupId>
        <artifactId>gmaven-plugin</artifactId>
        <version>1.5</version>
        <executions>
          <execution>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>execute</goal>
            </goals>
            <configuration>
              <properties>
                <thrift.help.cmd>${thrift.command} -help</thrift.help.cmd>
                <thrift.xml.cmd>${thrift.command} -gen xml:merge -out target/tests/models</thrift.xml.cmd>
              </properties>
              <source><![CDATA[
  def command = project.properties["thrift.help.cmd"]
  def process = command.execute()
  process.waitFor()
  def xmlSupported = process.err.text.contains("  xml (XML)")
  project.properties.useSwiftParser = (!xmlSupported).toString()
  log.info "useSwiftParser = " + project.properties.useSwiftParser 
  if (xmlSupported) {
    def cmd = project.properties["thrift.xml.cmd"] 
    def finder = new FileNameFinder()
    def filenames = finder.getFileNames("src/test/thrift", "*.thrift")
    new File("target/tests/models").mkdirs()
    filenames.each { filename ->
      def file = new File(filename)
      log.info "processing thrift file: " + file.name
      process = (cmd + " "  + file.absolutePath).execute()
      if (process.waitFor() != 0) 
        fail("thrift generation failed: " + process.err.text)
    }
  }
              ]]></source>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.thrift.tools</groupId>
        <artifactId>maven-thrift-plugin</artifactId>
        <version>0.1.11</version>
        <executions>
          <execution>
            <id>thrift-generate-java</id>
            <phase>generate-test-sources</phase>
            <configuration>
              <generator>java</generator>
              <compileOutput>true</compileOutput>
            </configuration>
            <goals>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <argLine>-Dthriftee.use.swift.parser=@{useSwiftParser}</argLine>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

</project>
<commit_msg>updated XML project to use Swift parser instead of native Thrift XML if it is not available for tests<commit_after><!--

    Copyright (C) 2013-2016 <NAME>, and others

    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.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.thriftee</groupId>
    <artifactId>thriftee-root</artifactId>
    <version>0.3-SNAPSHOT</version>
  </parent>

  <artifactId>thriftee-xml-protocol</artifactId>
  <name>thriftee-xml-protocol</name>

  <dependencies>
    <dependency>
      <groupId>org.apache.thrift</groupId>
      <artifactId>libthrift</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
    </dependency>
    <dependency>
    <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.thriftee</groupId>
      <artifactId>thriftee-provider-swift</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>net.sf.saxon</groupId>
      <artifactId>Saxon-HE</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <properties>
    <thrift.command>thrift</thrift.command>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.gmaven</groupId>
        <artifactId>gmaven-plugin</artifactId>
        <version>1.5</version>
        <executions>
          <execution>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>execute</goal>
            </goals>
            <configuration>
              <properties>
                <thrift.help.cmd>${thrift.command} -help</thrift.help.cmd>
                <thrift.xml.cmd>${thrift.command} -gen xml:merge</thrift.xml.cmd>
              </properties>
              <source><![CDATA[
  def command = project.properties["thrift.help.cmd"]
  def process = command.execute()
  process.waitFor()
  def xmlSupported = process.err.text.contains("  xml (XML)")
  project.properties.useSwiftParser = (!xmlSupported).toString()
  log.info "useSwiftParser = " + project.properties.useSwiftParser 
  if (xmlSupported) {
    def inputdir = new File(project.basedir, "src/test/thrift")
    def outputdir = new File(project.basedir, "target/tests/models")
    def filenames = new FileNameFinder().getFileNames(inputdir.absolutePath, "*.thrift")
    def cmd = project.properties["thrift.xml.cmd"] + " -out " + outputdir
    outputdir.mkdirs()
    filenames.each { filename ->
      def file = new File(filename)
      log.info "processing thrift file: " + file.name
      process = (cmd + " "  + file.absolutePath).execute()
      if (process.waitFor() != 0) 
        fail("thrift generation failed: " + process.err.text)
    }
  }
              ]]></source>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.thrift.tools</groupId>
        <artifactId>maven-thrift-plugin</artifactId>
        <version>0.1.11</version>
        <executions>
          <execution>
            <id>thrift-generate-java</id>
            <phase>generate-test-sources</phase>
            <configuration>
              <generator>java</generator>
              <compileOutput>true</compileOutput>
            </configuration>
            <goals>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <argLine>-Dthriftee.use.swift.parser=@{useSwiftParser}</argLine>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

</project>

{'fraction_non_alphanumeric': 0.13772972972972972, 'fraction_numerical': 0.00908108108108108, 'mean_word_length': 2.5015140045420137, 'pattern_counts': {'":': 0, '<': 281, '<?xml version=': 0, '>': 283, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 24}, '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': '7633952', 'n_tokens_mistral': 2986, 'n_tokens_neox': 2739, 'n_words': 508}