private String replaceKnownVariables(String s) throws IOException { if (s.contains("${currentdir}")) { File pwd = localRepo.platform.pwd(); s = s.replace("${currentdir}", pwd.getCanonicalPath().replace("\\", "/")); s = s.replace("\"", ""); } if (s.contains("${repoURI}")) { URI uri = localRepo.repositoryURI; s = s.replace("${repoURI}", uri.toString()); } if (s.contains("${localrepo}")) { URI uri = localRepo.repositoryURI; s = s.replace("${localrepo}", uri.toString()); } if (s.contains("${remoterepo}")) { CLIContext remote = contextProvider.getRepositoryContext("remoterepo"); URI remoteURI = remote.repositoryURI; s = s.replace("${remoterepo}", remoteURI.toString()); } if (s.contains("${remote repo}")) { CLIContext remote = contextProvider.getRepositoryContext("remote repo"); URI remoteURI = remote.repositoryURI; s = s.replace("${remote repo}", remoteURI.toString()); } if (s.contains("${rootRepoURI}")) { URI rootRepoURI = contextProvider.getURIBuilder().buildRootURI(localRepo.platform); s = s.replace("${rootRepoURI}", rootRepoURI.toString()); } return s; }
private String replaceKnownVariables(String s) throws IOException { if (s.contains("${currentdir}")) { File pwd = localRepo.platform.pwd(); s = s.replace("${currentdir}", pwd.getCanonicalPath().replace("\\", "/")); s = s.replace("\"", ""); } if (s.contains("${repoURI}")) { URI uri = localRepo.repositoryURI; s = s.replace("${repoURI}", uri.toString()); } if (s.contains("${localrepo}")) { URI uri = localRepo.repositoryURI; s = s.replace("${localrepo}", uri.toString()); } if (s.contains("${remoterepo}")) { CLIContext remote = contextProvider.getRepositoryContext("remoterepo"); URI remoteURI = remote.repositoryURI; s = s.replace("${remoterepo}", remoteURI.toString()); } if (s.contains("${remote repo}")) { CLIContext remote = contextProvider.getRepositoryContext("remote repo"); URI remoteURI = remote.repositoryURI; s = s.replace("${remote repo}", remoteURI.toString()); } if (s.contains("${rootRepoURI}")) { URI rootRepoURI = contextProvider.getURIBuilder().buildRootURI(localRepo.platform); s = s.replace("${rootRepoURI}", rootRepoURI.toString()); } return s; }
private String replaceKnownVariables(String s) throws IOException { if (s.contains("${currentdir}")) { File pwd = localRepo.platform.pwd(); s = s.replace("${currentdir}", pwd.getCanonicalPath().replace("\\", "/")); s = s.replace("\"", ""); } if (s.contains("${repoURI}")) { URI uri = localRepo.repositoryURI; s = s.replace("${repoURI}", uri.toString()); } if (s.contains("${localrepo}")) { URI uri = localRepo.repositoryURI; s = s.replace("${localrepo}", uri.toString()); } if (s.contains("${remoterepo}")) { CLIContext remote = contextProvider.getRepositoryContext("remoterepo"); URI remoteURI = remote.repositoryURI; s = s.replace("${remoterepo}", remoteURI.toString()); } if (s.contains("${remote repo}")) { CLIContext remote = contextProvider.getRepositoryContext("remote repo"); URI remoteURI = remote.repositoryURI; s = s.replace("${remote repo}", remoteURI.toString()); } if (s.contains("${rootRepoURI}")) { URI rootRepoURI = contextProvider.getURIBuilder().buildRootURI(localRepo.platform); s = s.replace("${rootRepoURI}", rootRepoURI.toString()); } return s; }
/** * Set up the context for a scenario. */ @Override protected void setUp() throws Exception { File rootFolder = tempFolder.getRoot(); this.platform = new TestPlatform(rootFolder); URI rootURI = TestRepoURIBuilderProvider.getURIBuilder().buildRootURI(platform); repoProvider = new MultiRepositoryProvider(rootURI); GlobalContextBuilder.builder(new FunctionalRepoContextBuilder(platform)); setVariable("@systemTempPath", rootFolder.getCanonicalPath().replace("\\", "/")); }