Skip to content

Commit

Permalink
fix config
Browse files Browse the repository at this point in the history
  • Loading branch information
andrecostea committed Aug 15, 2021
1 parent 35289a9 commit ef90236
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 49 deletions.
10 changes: 10 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@
<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -116,6 +121,7 @@
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>org.racerdfix.Hippodrome</mainClass>
</manifest>
</archive>
Expand All @@ -128,6 +134,9 @@
<manifest>
<mainClass>org.racerdfix.Hippodrome</mainClass>
</manifest>
<!-- <manifestEntries>
<Class-Path>config/</Class-Path>
</manifestEntries> -->
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
Expand Down Expand Up @@ -157,6 +166,7 @@
<version>3.2.2</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/main/scala/inferAPI/InterpretJson.scala
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ class InterpretJson(val config: FixConfig) {
def getJsonToolConfig() = {
import ToolConfigProtocol._
val fm = new FileManipulation
val src = fm.fileToString(config.tools_config_file)
val src = fm.resourceFileToString(config.tools_config_file)
val jsonAst = src.parseJson
val toolsConfigObj = jsonAst.convertTo[ToolConfig]
toolsConfigObj
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/utils/BugsStore.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class BugsStore {
key
}

val key = contains_key(true)
val key = contains_key(true)
val key2 = contains_key(false)

key match {
Expand Down
22 changes: 21 additions & 1 deletion src/main/scala/utils/FileManipulation.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package org.racerdfix.utils

import java.io.{BufferedWriter, File, FileWriter}
import java.io.{BufferedWriter, File, FileNotFoundException, FileWriter, InputStream}
import java.nio.file.{Files, Paths, StandardCopyOption}

import scala.io.Source
import scala.util.Try

class FileManipulation {

Expand Down Expand Up @@ -49,6 +50,25 @@ class FileManipulation {
Source.fromFile(filename).getLines.foldLeft("") { (str, line) => str + " \n " + line.toString }
}

def resourceFileToString(filename: String) = {
/*
def main(args: Array[String]): Unit = {
val ipfileStream = getClass.getResourceAsStream("/folder/a-words.txt")
val readlines = Source.fromInputStream(ipfileStream).getLines
readlines.foreach(readlines => println(readlines))
}
* */
//val stream: InputStream = getClass.getResourceAsStream("/" + filename)
println(getClass.getResource(filename))
println(filename)
/*Try(*/
Source.fromResource(filename).getLines.foldLeft("") { (str, line) => str + " \n " + line.toString }
/*).recover(throw new FileNotFoundException(filename))
""*/
}

def getFile(path: String, filename: String) = {
/* TODO strip the last / from path*/
val path_processes = if(path.length > 0 && path.last == '/') path.dropRight(1) else path
Expand Down
46 changes: 0 additions & 46 deletions src/test/java/account/ManageAccount.java

This file was deleted.

0 comments on commit ef90236

Please sign in to comment.