[DEV] init is ready ==> need rework arguments
This commit is contained in:
parent
2b36761fa5
commit
57121cd339
17
.classpath
17
.classpath
@ -30,12 +30,7 @@
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="lib/org.eclipse.jgit-5.12.0.202106070339-r.jar">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="lib/slf4j-api-1.7.31.jar">
|
||||
<classpathentry kind="lib" path="lib/jgit_bundle-5.12.0.jar">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
@ -45,20 +40,10 @@
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="lib/org.eclipse.jgit.ssh.apache-5.12.0.202106070339-r.jar">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5">
|
||||
<attributes>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="lib/sshd-core-2.7.0.jar"/>
|
||||
<classpathentry kind="lib" path="lib/sshd-sftp-2.7.0.jar"/>
|
||||
<classpathentry kind="lib" path="lib/eddsa-0.3.0.jar"/>
|
||||
<classpathentry kind="lib" path="lib/sshd-common-2.7.0.jar"/>
|
||||
<classpathentry kind="lib" path="lib/sshd-osgi-2.7.0.jar"/>
|
||||
<classpathentry kind="output" path="out/eclipse/classes"/>
|
||||
</classpath>
|
||||
|
2
generator_bundle_jgit/README.md
Normal file
2
generator_bundle_jgit/README.md
Normal file
@ -0,0 +1,2 @@
|
||||
mvn package
|
||||
mv target/jgit-bundle-5.12.0-jar-with-dependencies.jar ../lib/jgit-bundle-5.12.0.jar
|
66
generator_bundle_jgit/pom.xml
Normal file
66
generator_bundle_jgit/pom.xml
Normal file
@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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/maven-v4_0_0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.atriasoft</groupId>
|
||||
<artifactId>jgit_bundle</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>5.12.0</version>
|
||||
<name>org.atriasoft.jgit_bundle</name>
|
||||
<properties>
|
||||
<jgit-version>5.12.0.202106070339-r</jgit-version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- logging -->
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-slf4j-impl</artifactId>
|
||||
<version>2.13.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.eclipse.jgit/org.eclipse.jgit -->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jgit</groupId>
|
||||
<artifactId>org.eclipse.jgit</artifactId>
|
||||
<version>${jgit-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jgit</groupId>
|
||||
<artifactId>org.eclipse.jgit.http.apache</artifactId>
|
||||
<version>${jgit-version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jgit</groupId>
|
||||
<artifactId>org.eclipse.jgit.ssh.apache</artifactId>
|
||||
<version>${jgit-version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<defaultGoal>install</defaultGoal>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
BIN
lib/jgit_bundle-5.12.0.jar
Normal file
BIN
lib/jgit_bundle-5.12.0.jar
Normal file
Binary file not shown.
@ -13,7 +13,6 @@ open module org.atriasoft.island {
|
||||
requires org.atriasoft.death;
|
||||
requires org.atriasoft.exml;
|
||||
requires org.atriasoft.etk;
|
||||
requires org.eclipse.jgit;
|
||||
requires org.eclipse.jgit.ssh.apache;
|
||||
|
||||
//requires org.eclipse.jgit;
|
||||
requires jgit.bundle;
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ public class Manifest {
|
||||
|
||||
public List<Link> getLinks() {
|
||||
List<Link> out = new ArrayList<>();
|
||||
for (Entry<String, ManifestFile> elem : manifests.entrySet()) {
|
||||
for (Entry<String, ManifestFile> elem : this.manifests.entrySet()) {
|
||||
for (Link link : elem.getValue().getLinks()) {
|
||||
out.add(link);
|
||||
}
|
||||
@ -89,6 +89,7 @@ public class Manifest {
|
||||
this.rootManifest = rootDirectory.getFileName().toString();
|
||||
rootDirectory = rootDirectory.getParent();
|
||||
|
||||
Log.info("PArse main XML config " + rootDirectory);
|
||||
ManifestFile parsedElements = null;
|
||||
try {
|
||||
parsedElements = Exml.parseOne(this.manifestXml, ManifestFile.class, "manifest");
|
||||
@ -100,6 +101,7 @@ public class Manifest {
|
||||
this.manifests.put(this.rootManifest, parsedElements);
|
||||
for (String includeElem : parsedElements.getIncludes()) {
|
||||
Path maniPath = rootDirectory.resolve(includeElem);
|
||||
Log.info("PArse <<SUB>> XML config " + maniPath);
|
||||
ManifestFile tmpManifest = null;
|
||||
try {
|
||||
tmpManifest = Exml.parseOne(maniPath, ManifestFile.class, "manifest");
|
||||
@ -360,7 +362,7 @@ public class Manifest {
|
||||
return get_all_configs(mani, null, new ArrayList<>());
|
||||
}
|
||||
|
||||
public List<ProjectConfig> get_all_configs(ManifestFile mani, OptionRepository defaultPlouf, final List<RemoteConfig> upper_remotes) {
|
||||
public List<ProjectConfig> get_all_configs(final ManifestFile mani, OptionRepository defaultPlouf, final List<RemoteConfig> upper_remotes) {
|
||||
List<ProjectConfig> out = new ArrayList<>();
|
||||
if (defaultPlouf == null) {
|
||||
if (this.defaultWhat != null) {
|
||||
|
@ -95,7 +95,11 @@ public class IslandActionInit extends ActionInterface {
|
||||
.setDirectory( Env.get_island_path_manifest().toFile() )
|
||||
.setBranch(branch)
|
||||
.call();
|
||||
|
||||
// TODO check all is good ==> return ...
|
||||
|
||||
return;
|
||||
|
||||
/*
|
||||
if ret_values == false:
|
||||
Log.info("'" + str(ret_values) + "'")
|
||||
@ -105,7 +109,7 @@ public class IslandActionInit extends ActionInterface {
|
||||
Log.info("Init done correctly ...")
|
||||
|
||||
return None
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@ -114,12 +118,14 @@ public class IslandActionInit extends ActionInterface {
|
||||
Log.critical("Missing manifest file : '" + file_source_manifest + "'");
|
||||
}
|
||||
Manifest mani = new Manifest(file_source_manifest);
|
||||
Log.error("Manifest loaded: config Len=" + mani.get_all_configs().size());
|
||||
/*
|
||||
Git git = Git.open(Env.get_island_path_manifest().toFile());
|
||||
boolean is_modify_manifest = git.status().call().hasUncommittedChanges();
|
||||
if (is_modify_manifest) {
|
||||
Log.info("!!!!!!!!!!!! MANIFEST is modify !!!!!!!!");
|
||||
}
|
||||
|
||||
*/
|
||||
List<ProjectConfig> all_project = mani.get_all_configs();
|
||||
Log.info("status of: " + all_project.size() + " projects");
|
||||
int id_element = 0;
|
||||
@ -128,17 +134,20 @@ public class IslandActionInit extends ActionInterface {
|
||||
for (ProjectConfig elem : all_project) {
|
||||
id_element++;
|
||||
String base_display = Tools.get_list_base_display(id_element, all_project.size(), elem);
|
||||
Log.error(" base display: " + base_display);
|
||||
/*
|
||||
int ret = Status.displayStatus(elem, argument_remote_name, argument_display_tag, id_element, base_display);
|
||||
if (ret != 0) {
|
||||
is_behind = true;
|
||||
}
|
||||
*/
|
||||
}
|
||||
if (is_behind == true) {
|
||||
//return Env.ret_action_need_updtate;
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.atriasoft.island.model;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -111,14 +112,15 @@ public class ConfigManifest {
|
||||
}
|
||||
}
|
||||
public void store(final Path path) throws ExmlBuilderException {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
try {
|
||||
Exml.generate(this, "config-island", builder);
|
||||
} catch (ExmlException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
Exml.store(path, this, "config-island");
|
||||
} catch (ExmlException ex) {
|
||||
Log.warning("detect throw: " + ex.getMessage());
|
||||
ex.printStackTrace();
|
||||
} catch (IOException ex) {
|
||||
Log.warning("detect throw: " + ex.getMessage());
|
||||
ex.printStackTrace();
|
||||
}
|
||||
Log.warning("data generated: " + builder.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,23 +1,29 @@
|
||||
package org.atriasoft.island.model;
|
||||
|
||||
import org.atriasoft.exml.annotation.XmlDefaultAttibute;
|
||||
import org.atriasoft.exml.annotation.XmlName;
|
||||
|
||||
@XmlDefaultAttibute
|
||||
public class MirrorConfig {
|
||||
private String name;
|
||||
private String fetch;
|
||||
|
||||
|
||||
@XmlName({"name", "fetch"})
|
||||
public MirrorConfig(final String name, final String fetch) {
|
||||
this.name = name;
|
||||
this.fetch = fetch;
|
||||
}
|
||||
|
||||
|
||||
@XmlName("name")
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
public void setName(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
@XmlName("fetch")
|
||||
public String getFetch() {
|
||||
return this.fetch;
|
||||
}
|
||||
|
@ -3,9 +3,12 @@ package org.atriasoft.island.model;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.atriasoft.exml.annotation.XmlDefaultAttibute;
|
||||
import org.atriasoft.exml.annotation.XmlManaged;
|
||||
import org.atriasoft.exml.annotation.XmlName;
|
||||
import org.atriasoft.exml.annotation.XmlOptional;
|
||||
|
||||
@XmlDefaultAttibute
|
||||
public class ProjectConfig {
|
||||
private String name;
|
||||
private String path;
|
||||
@ -20,6 +23,7 @@ public class ProjectConfig {
|
||||
this.path = null;
|
||||
this.tag = null;
|
||||
}
|
||||
@XmlName({"name", "path", "tag"})
|
||||
public ProjectConfig(final String name, final String path, final String tag) {
|
||||
this.name = name;
|
||||
this.path = path;
|
||||
|
@ -4,12 +4,14 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.atriasoft.exml.annotation.XmlAttribute;
|
||||
import org.atriasoft.exml.annotation.XmlName;
|
||||
|
||||
public class RemoteConfig {
|
||||
private String name;
|
||||
private String fetch;
|
||||
List<MirrorConfig> mirror;
|
||||
|
||||
@XmlName({"name", "fetch", "mirror"})
|
||||
public RemoteConfig(final String name, final String fetch, final List<MirrorConfig> mirror) {
|
||||
this.name = name;
|
||||
this.fetch = fetch;
|
||||
|
Loading…
Reference in New Issue
Block a user