[ 
https://issues.apache.org/jira/browse/MBUILDCACHE-90?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17840567#comment-17840567
 ] 

ASF GitHub Bot commented on MBUILDCACHE-90:
-------------------------------------------

kbuntrock commented on code in PR #103:
URL: 
https://github.com/apache/maven-build-cache-extension/pull/103#discussion_r1578481429


##########
src/test/java/org/apache/maven/buildcache/util/LogFileUtils.java:
##########
@@ -60,4 +61,32 @@ public static String 
findFirstLineContainingTextsInLogs(final Verifier verifier,
 
         return null;
     }
+
+    /**
+     * Find lines matching all the strings given as parameter in the log file 
attached to a verifier
+     * @param verifier the maven verifier instance
+     * @param texts all the matching strings to find
+     * @return a list of matching strings
+     * @throws VerificationException
+     */
+    public static List<String> findLinesContainingTextsInLogs(final Verifier 
verifier, final String... texts)
+            throws VerificationException {
+        List<String> lines = verifier.loadFile(verifier.getBasedir(), 
verifier.getLogFileName(), false);
+        List<String> result = new ArrayList<>();
+        Iterator it = lines.iterator();
+
+        while (it.hasNext()) {
+            String line = verifier.stripAnsi((String) it.next());
+            boolean matches = true;
+            Iterator<String> toMatchIterator = Arrays.stream(texts).iterator();

Review Comment:
   Done. Slightly changed you proposal since the goal is to test the presence 
of all strings.



##########
src/main/java/org/apache/maven/buildcache/xml/CacheConfigImpl.java:
##########
@@ -503,6 +503,11 @@ public String getAlwaysRunPlugins() {
         return getProperty(ALWAYS_RUN_PLUGINS, null);
     }
 
+    @Override
+    public boolean isMandatoryClean() {
+        return getConfiguration().isMandatoryClean();

Review Comment:
   Done :)





> Configuration option to make mandatory the use of the clean phase in order to 
> cache the build result
> ----------------------------------------------------------------------------------------------------
>
>                 Key: MBUILDCACHE-90
>                 URL: https://issues.apache.org/jira/browse/MBUILDCACHE-90
>             Project: Maven Build Cache Extension
>          Issue Type: New Feature
>            Reporter: Kevin Buntrock
>            Priority: Minor
>
> Add a configuration option to make mandatory the use of the clean phase in 
> order to cache the build result.
> The goal is to offer the possibility of denying as much as possible the 
> possibility to cache a faulty build.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to