@Test public void convertCompileDependencyToBuildr() throws Exception { String gradleDep = "compile 'junit:junit:4.12'"; String buildrDep = new Buildr().convertDependencyToBuildr(gradleDep); assertThat(buildrDep).isEqualTo("compile.with 'junit:junit:jar:4.12'"); }
String convertDependencyToBuildr(String gradleFormat) { gradleFormat = gradleFormat.replaceAll("testCompile", "test.with"); gradleFormat = gradleFormat.replaceAll("compile", "compile.with"); String[] split = gradleFormat.split(":"); List<String> stringList = Arrays.stream(split).collect(Collectors.toList()); stringList.add(2, "jar"); return stringList.stream().collect(Collectors.joining(":")); }
Buildr extends BuildTool { String convertDependencyToBuildr(String gradleFormat) { gradleFormat = gradleFormat.replaceAll("testCompile", "test.with"); gradleFormat = gradleFormat.replaceAll("compile", "compile.with"); String[] split = gradleFormat.split(":"); List<String> stringList = Arrays.stream(split).collect(Collectors.toList()); stringList.add(2, "jar"); return stringList.stream().collect(Collectors.joining(":")); } }
Buildr extends BuildTool { String convertDependencyToBuildr(String gradleFormat) { gradleFormat = gradleFormat.replaceAll("testCompile", "test.with"); gradleFormat = gradleFormat.replaceAll("compile", "compile.with"); String[] split = gradleFormat.split(":"); List<String> stringList = Arrays.stream(split).collect(Collectors.toList()); stringList.add(2, "jar"); return stringList.stream().collect(Collectors.joining(":")); }  }
Buildr extends BuildTool { String convertDependencyToBuildr(String gradleFormat) { gradleFormat = gradleFormat.replaceAll("testCompile", "test.with"); gradleFormat = gradleFormat.replaceAll("compile", "compile.with"); String[] split = gradleFormat.split(":"); List<String> stringList = Arrays.stream(split).collect(Collectors.toList()); stringList.add(2, "jar"); return stringList.stream().collect(Collectors.joining(":")); }   }
Buildr extends BuildTool { String convertDependencyToBuildr(String gradleFormat) { gradleFormat = gradleFormat.replaceAll("testCompile", "test.with"); gradleFormat = gradleFormat.replaceAll("compile", "compile.with"); String[] split = gradleFormat.split(":"); List<String> stringList = Arrays.stream(split).collect(Collectors.toList()); stringList.add(2, "jar"); return stringList.stream().collect(Collectors.joining(":")); }    }