projects
/
cc0
/
argeo-build.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
949c81c
)
Always package sources separately for unmodified jars
author
Mathieu Baudier <mbaudier@argeo.org>
Wed, 22 Mar 2023 16:04:41 +0000
(17:04 +0100)
committer
Mathieu Baudier <mbaudier@argeo.org>
Wed, 22 Mar 2023 16:04:41 +0000
(17:04 +0100)
src/org/argeo/build/Repackage.java
patch
|
blob
|
history
diff --git
a/src/org/argeo/build/Repackage.java
b/src/org/argeo/build/Repackage.java
index e9606f3e637e1fcedba20295665f590c6a19aa48..0eec4fad7d7b57d5b6d30838e711771cadc3397c 100644
(file)
--- a/
src/org/argeo/build/Repackage.java
+++ b/
src/org/argeo/build/Repackage.java
@@
-232,12
+232,12
@@
public class Repackage {
final Map<String, List<String>> mirrors = new HashMap<String, List<String>>();
/** Whether sources should be packaged separately */
final Map<String, List<String>> mirrors = new HashMap<String, List<String>>();
/** Whether sources should be packaged separately */
- final boolean s
ourceBundl
es;
+ final boolean s
eparateSourc
es;
/** Constructor initialises the various variables */
public Repackage(Path a2Base, Path descriptorsBase) {
/** Constructor initialises the various variables */
public Repackage(Path a2Base, Path descriptorsBase) {
- s
ourceBundl
es = Boolean.parseBoolean(System.getenv(ENV_SOURCE_BUNDLES));
- if (s
ourceBundl
es)
+ s
eparateSourc
es = Boolean.parseBoolean(System.getenv(ENV_SOURCE_BUNDLES));
+ if (s
eparateSourc
es)
logger.log(INFO, "Sources will be packaged separately");
Objects.requireNonNull(a2Base);
logger.log(INFO, "Sources will be packaged separately");
Objects.requireNonNull(a2Base);
@@
-247,7
+247,7
@@
public class Repackage {
// TODO define and use a build base
this.a2Base = a2Base;
// TODO define and use a build base
this.a2Base = a2Base;
- this.a2SrcBase =
a2Base.getParent().resolve(a2Base.getFileName() + ".src")
;
+ this.a2SrcBase =
separateSources ? a2Base.getParent().resolve(a2Base.getFileName() + ".src") : a2Base
;
this.a2LibBase = a2Base.resolve("lib");
this.descriptorsBase = descriptorsBase;
if (!Files.exists(this.descriptorsBase))
this.a2LibBase = a2Base.resolve("lib");
this.descriptorsBase = descriptorsBase;
if (!Files.exists(this.descriptorsBase))
@@
-334,7
+334,7
@@
public class Repackage {
boolean doNotModify = Boolean
.parseBoolean(fileProps.getOrDefault(ARGEO_DO_NOT_MODIFY.toString(), "false").toString());
boolean doNotModify = Boolean
.parseBoolean(fileProps.getOrDefault(ARGEO_DO_NOT_MODIFY.toString(), "false").toString());
- if (doNotModify
&& sourceBundles
) {
+ if (doNotModify) {
processNotModified(targetCategoryBase, downloaded, fileProps, artifact);
return;
}
processNotModified(targetCategoryBase, downloaded, fileProps, artifact);
return;
}
@@
-429,7
+429,7
@@
public class Repackage {
boolean doNotModify = Boolean
.parseBoolean(mergedProps.getOrDefault(ARGEO_DO_NOT_MODIFY.toString(), "false").toString());
boolean doNotModify = Boolean
.parseBoolean(mergedProps.getOrDefault(ARGEO_DO_NOT_MODIFY.toString(), "false").toString());
- if (doNotModify
&& sourceBundles
) {
+ if (doNotModify) {
processNotModified(targetCategoryBase, downloaded, mergedProps, artifact);
} else {
A2Origin origin = new A2Origin();
processNotModified(targetCategoryBase, downloaded, mergedProps, artifact);
} else {
A2Origin origin = new A2Origin();
@@
-742,7
+742,7
@@
public class Repackage {
/** Integrate sources from a downloaded jar file. */
void processM2SourceJar(Path file, Path bundleDir, M2Artifact mergingFrom) throws IOException {
A2Origin origin = new A2Origin();
/** Integrate sources from a downloaded jar file. */
void processM2SourceJar(Path file, Path bundleDir, M2Artifact mergingFrom) throws IOException {
A2Origin origin = new A2Origin();
- Path sourceDir = s
ourceBundl
es ? bundleDir.getParent().resolve(bundleDir.toString() + ".src")
+ Path sourceDir = s
eparateSourc
es ? bundleDir.getParent().resolve(bundleDir.toString() + ".src")
: bundleDir.resolve("OSGI-OPT/src");
try (JarInputStream jarIn = new JarInputStream(Files.newInputStream(file), false)) {
: bundleDir.resolve("OSGI-OPT/src");
try (JarInputStream jarIn = new JarInputStream(Files.newInputStream(file), false)) {
@@
-786,7
+786,7
@@
public class Repackage {
}
}
// write the changes
}
}
// write the changes
- if (s
ourceBundl
es) {
+ if (s
eparateSourc
es) {
origin.appendChanges(sourceDir);
} else {
origin.added.add("source code under OSGI-OPT/src");
origin.appendChanges(sourceDir);
} else {
origin.added.add("source code under OSGI-OPT/src");
@@
-925,7
+925,7
@@
public class Repackage {
NameVersion nameVersion = new NameVersion(relatedBundle[0], version);
bundleDir = targetBase.resolve(nameVersion.getName() + "." + nameVersion.getBranch());
NameVersion nameVersion = new NameVersion(relatedBundle[0], version);
bundleDir = targetBase.resolve(nameVersion.getName() + "." + nameVersion.getBranch());
- Path sourceDir = s
ourceBundl
es ? bundleDir.getParent().resolve(bundleDir.toString() + ".src")
+ Path sourceDir = s
eparateSourc
es ? bundleDir.getParent().resolve(bundleDir.toString() + ".src")
: bundleDir.resolve("OSGI-OPT/src");
Files.createDirectories(sourceDir);
: bundleDir.resolve("OSGI-OPT/src");
Files.createDirectories(sourceDir);
@@
-942,7
+942,7
@@
public class Repackage {
}
// write the changes
}
// write the changes
- if (s
ourceBundl
es) {
+ if (s
eparateSourc
es) {
origin.appendChanges(sourceDir);
} else {
origin.added.add("source code under OSGI-OPT/src");
origin.appendChanges(sourceDir);
} else {
origin.added.add("source code under OSGI-OPT/src");
@@
-1359,7
+1359,7
@@
public class Repackage {
}
deleteDirectory(bundleDir);
}
deleteDirectory(bundleDir);
- if (s
ourceBundl
es)
+ if (s
eparateSourc
es)
createSourceJar(bundleDir, manifest, false);
return jarPath;
createSourceJar(bundleDir, manifest, false);
return jarPath;
@@
-1471,7
+1471,7
@@
public class Repackage {
writer.append("\nA detailed list of changes is available under " + CHANGES + ".\n");
if (!jarDir.getFileName().endsWith(".src")) {// binary archive
writer.append("\nA detailed list of changes is available under " + CHANGES + ".\n");
if (!jarDir.getFileName().endsWith(".src")) {// binary archive
- if (s
ourceBundl
es)
+ if (s
eparateSourc
es)
writer.append("Corresponding sources are available in the related archive named "
+ jarDir.toString() + ".src.jar.\n");
else
writer.append("Corresponding sources are available in the related archive named "
+ jarDir.toString() + ".src.jar.\n");
else