Closed Marcono1234 closed 2 years ago
I'm trying to think of a clean way of testing multiple module specs in current cfrtest project - any improvement on adding a bunch of top level source dirs and then including them in every j14+ build?
On Wed, 26 Jan 2022, 18:49 Marcono1234, @.***> wrote:
- Properly dumps requires static (instead of including / static phase /)
- Dumps uses directives (they were missing before)
- Dumps information about module versions as comments, if present
Example:
module test { requires static java.sql;
uses java.util.List;
}
Compile with javac --module-version=99 .\module-info.java.
Output:
/ Decompiled with CFR 0.153-SNAPSHOT (a260598). */import java.util.List;
open module test { // version: 99
requires static java.sql /* version: 17 */; uses List;
}
You can view, comment on, or merge this pull request online at:
https://github.com/leibnitz27/cfr/pull/287 Commit Summary
- fadad29 https://github.com/leibnitz27/cfr/pull/287/commits/fadad29a5ab094b67325bceff35cfeedbf5d817e Fix module
requires static
not being dumped correctly- 4d9f2fc https://github.com/leibnitz27/cfr/pull/287/commits/4d9f2fc011897178c574e3a6409529457652914b Dump module
uses
directives- 419c091 https://github.com/leibnitz27/cfr/pull/287/commits/419c09141142bc7eb00bf9ad12e4001adae6a07e Dump module version comments
File Changes
(2 files https://github.com/leibnitz27/cfr/pull/287/files)
- M src/org/benf/cfr/reader/entities/attributes/AttributeModule.java https://github.com/leibnitz27/cfr/pull/287/files#diff-195e4b225136545e425ba0a8ff59f5cd2c43dccbbd3e4192a10e637904edb8e4 (29)
- M src/org/benf/cfr/reader/entities/classfilehelpers/ClassFileDumperModule.java https://github.com/leibnitz27/cfr/pull/287/files#diff-cb63fc67410c34ca92e9920dc61df438f177ae78595a053a9e50b653222401c9 (32)
Patch Links:
— Reply to this email directly, view it on GitHub https://github.com/leibnitz27/cfr/pull/287, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFXCEAEICFYE66GCRBZ4JLUYA643ANCNFSM5M32JDIA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you are subscribed to this thread.Message ID: @.***>
\o/ thanks!
I'm trying to think of a clean way of testing multiple module specs in current cfrtest project - any improvement on adding a bunch of top level source dirs and then including them in every j14+ build?
Not really. Is that even possible or does Maven then complain about too many module declarations?
One really hacky solution might be to specify multiple Maven Compiler Plugin executions each with different inclusions for module-info.java
files, and then passing the javac -d
option to specify a custom output directory, e.g.:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.9.0</version>
<configuration>
<includes>
<!-- Specify no include for default compile -->
<include></include>
</includes>
</configuration>
<executions>
<execution>
<id>compile1</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<includes>
<include>first/module-info.java</include>
</includes>
<compilerArgs>
<arg>-d</arg>
<arg>custom-out</arg>
</compilerArgs>
</configuration>
</execution>
<execution>
<id>compile2</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<includes>
<include>second/module-info.java</include>
</includes>
<compilerArgs>
<arg>-d</arg>
<arg>custom-out2</arg>
</compilerArgs>
</configuration>
</execution>
</executions>
</plugin>
But I wouldn't be surprised if that breaks in the future.
Maybe including the compiled module descriptors in the hardcoded
folder of cfr_tests would be fine as well?
requires static
(instead of including/* static phase */
)uses
directives (they were missing before)Example:
Compile with
javac --module-version=99 .\module-info.java
.Output: