use of gen.core.project.RepositoryDefinition in project omegat by omegat-org.
the class RepositoriesMappingController method getData.
List<RepositoryDefinition> getData() {
List<RepositoryDefinition> result = new ArrayList<RepositoryDefinition>();
for (RowRepo r : listRepo) {
RepositoryDefinition rd = new RepositoryDefinition();
rd.setType(r.type.name().toLowerCase(Locale.ENGLISH));
rd.setUrl(r.url);
result.add(rd);
for (RowMapping m : listMapping) {
if (r.url.equals(m.repoUrl)) {
RepositoryMapping rm = new RepositoryMapping();
rm.setLocal(normalizeMapping(m.local));
rm.setRepository(normalizeMapping(m.remote));
if (!StringUtil.isEmpty(m.excludes)) {
rm.getExcludes().addAll(Arrays.asList(m.excludes.trim().split(";")));
}
if (!StringUtil.isEmpty(m.includes)) {
rm.getIncludes().addAll(Arrays.asList(m.includes.trim().split(";")));
}
rd.getMapping().add(rm);
}
}
}
return result;
}
use of gen.core.project.RepositoryDefinition in project omegat by omegat-org.
the class RepositoriesMappingController method putData.
void putData(List<RepositoryDefinition> data) {
if (data == null) {
return;
}
for (RepositoryDefinition rd : data) {
RowRepo r = new RowRepo();
r.type = RepoType.valueOf(rd.getType().toUpperCase(Locale.ENGLISH));
r.url = rd.getUrl();
listRepo.add(r);
for (RepositoryMapping rm : rd.getMapping()) {
RowMapping m = new RowMapping();
m.repoUrl = rd.getUrl();
m.local = normalizeMapping(rm.getLocal());
m.remote = normalizeMapping(rm.getRepository());
m.excludes = String.join(";", rm.getExcludes());
m.includes = String.join(";", rm.getIncludes());
listMapping.add(m);
}
}
}
use of gen.core.project.RepositoryDefinition in project omegat by omegat-org.
the class TestTeamIntegration method createConfig.
static ProjectProperties createConfig(String repoUrl, File dir) throws Exception {
ProjectProperties config = new ProjectProperties(dir);
config.setSourceLanguage(SRC_LANG);
config.setTargetLanguage(TRG_LANG);
RepositoryDefinition def = new RepositoryDefinition();
if (repoUrl.startsWith("git") || repoUrl.endsWith(".git")) {
def.setType("git");
} else if (repoUrl.startsWith("svn") || repoUrl.startsWith("http") || repoUrl.endsWith(".svn")) {
def.setType("svn");
} else {
throw new RuntimeException("Unknown repo");
}
def.setUrl(repoUrl);
RepositoryMapping m = new RepositoryMapping();
m.setLocal("");
m.setRepository("");
def.getMapping().add(m);
config.setRepositories(new ArrayList<RepositoryDefinition>());
config.getRepositories().add(def);
return config;
}
use of gen.core.project.RepositoryDefinition in project omegat by omegat-org.
the class RemoteRepositoryProviderTest method addRepo.
void addRepo(String localPath, String repoPath, String... excludes) {
RepositoryMapping m = new RepositoryMapping();
m.setLocal(localPath);
m.setRepository(repoPath);
m.getExcludes().addAll(Arrays.asList(excludes));
RepositoryDefinition def = new RepositoryDefinition();
def.setUrl("url");
def.getMapping().add(m);
repos.add(def);
provider.repositories.add(null);
}
use of gen.core.project.RepositoryDefinition in project omegat by omegat-org.
the class RemoteRepositoryProviderTest method setUp.
@Before
public final void setUp() throws Exception {
File dir = new File("build/testdata/repotest");
FileUtils.deleteDirectory(dir);
dir.mkdirs();
V = dir.getAbsolutePath() + "/";
VR = dir.getAbsolutePath() + "/.repositories/url/";
repos = new ArrayList<RepositoryDefinition>();
provider = new VirtualRemoteRepositoryProvider(repos);
files = new ArrayList<String>();
}
Aggregations