Skip to content

Commit 6e9a8bf

Browse files
committed
bug(#4987): fixed classedDir
1 parent 31da08e commit 6e9a8bf

7 files changed

Lines changed: 170 additions & 17 deletions

File tree

eo-integration-tests/src/test/java/integration/JarIT.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
/**
2727
* Integration test that runs simple EO program from packaged jar.
2828
* @since 0.54
29+
* @todo #4987:30min Enable JarIt integration tests. The tests were disabled because of this ticket:
30+
* https://github.com/objectionary/eo/issues/4987?issue=objectionary%7Ceo%7C4538. When new release
31+
* is made, we should try to enable them. Don't forget to remove the puzzle.
2932
*/
3033
@SuppressWarnings({"JTCOP.RuleAllTestsHaveProductionClass", "PMD.UnitTestShouldIncludeAssert"})
3134
@ExtendWith(MktmpResolver.class)
@@ -166,6 +169,7 @@ void runsProgramWithTwoObjects(final @Mktmp Path temp) throws IOException {
166169
);
167170
}
168171

172+
@Disabled
169173
@Test
170174
@ExtendWith(WeAreOnline.class)
171175
@ExtendWith(MayBeSlow.class)

eo-maven-plugin/src/main/java/org/eolang/maven/MjSafe.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ abstract class MjSafe extends AbstractMojo {
7979
* @checkstyle MemberNameCheck (8 lines)
8080
*/
8181
@Parameter(
82-
defaultValue = "${project.build.directory}/classes/org/eolang",
82+
defaultValue = "${project.build.directory}/classes",
8383
readonly = true,
8484
required = true
8585
)

eo-maven-plugin/src/test/java/org/eolang/maven/MjUnspileTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ void keepsSpecifiedClasses(@Mktmp final Path temp) throws IOException {
6767
@SuppressWarnings("PMD.UnnecessaryLocalRule")
6868
void deletesInnerGeneratedClasses(@Mktmp final Path temp) throws IOException {
6969
final FakeMaven maven = new FakeMaven(temp);
70-
new Saved("outer", maven.generatedPath().resolve("EOorg/EOnumber.java")).value();
70+
new Saved("outer", maven.generatedPath().resolve("org/EOnumber.java")).value();
7171
final Path clazz = new Saved(
72-
"clz", maven.classesPath().resolve("EOorg/EOnumber.class")
72+
"clz", maven.classesPath().resolve("org/EOnumber.class")
7373
).value();
7474
final Path inner = new Saved(
75-
"inner", maven.classesPath().resolve("EOorg/EOnumber$1$2$3.class")
75+
"inner", maven.classesPath().resolve("org/EOnumber$1$2$3.class")
7676
).value();
7777
final Path located = new Saved(
78-
"clss", maven.classesPath().resolve("EOorg/EOnumber$EOΦorgeolanginner.class")
78+
"clss", maven.classesPath().resolve("org/EOnumber$EOΦorgeolanginner.class")
7979
).value();
8080
MatcherAssert.assertThat(
8181
"UnspileMojo must delete inner auto generated classes",

eo-maven-plugin/src/test/java/org/eolang/maven/ObjectsIndexTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void doesNotContainUnknownValue() throws Exception {
7979
void downloadsAndChecksFromRealSource() throws Exception {
8080
MatcherAssert.assertThat(
8181
"The index must contain the default value",
82-
new ObjectsIndex().contains("org.eolang.io.stdout"),
82+
new ObjectsIndex().contains("io.stdout"),
8383
Matchers.is(true)
8484
);
8585
}

eo-maven-plugin/src/test/java/org/eolang/maven/OyIndexedTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,6 @@ void checksIsDirectoryForDirectory() throws IOException {
9393
* Returns the stdout path.
9494
*/
9595
private String stdout() {
96-
return "org.eolang.io.stdout";
96+
return "io.stdout";
9797
}
9898
}

eo-maven-plugin/src/test/java/org/eolang/maven/OyRemoteTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void throwsExceptionOnInvalidUrlForDirectory() {
7878
void checksPresenceOfProgram() throws IOException {
7979
MatcherAssert.assertThat(
8080
"OyRemote positively checks the presence of the program in Objectionary",
81-
new OyRemote(new ChRemote("master")).contains("org.eolang.io.stdout"),
81+
new OyRemote(new ChRemote("master")).contains("io.stdout"),
8282
Matchers.is(true)
8383
);
8484
}
@@ -88,15 +88,15 @@ void checksPresenceOfProgram() throws IOException {
8888
void checksPresenceOfDirectory() throws IOException {
8989
MatcherAssert.assertThat(
9090
"OyRemote positively checks the presence of the directory in Objectionary",
91-
new OyRemote(new ChRemote("master")).contains("org.eolang.ms"),
91+
new OyRemote(new ChRemote("master")).contains("ms"),
9292
Matchers.is(true)
9393
);
9494
}
9595

9696
@Test
9797
@ExtendWith(WeAreOnline.class)
9898
void checksPresenceOfProgramWithNarrowHash() throws IOException {
99-
final String stdout = "org.eolang.io.stdout";
99+
final String stdout = "io.stdout";
100100
MatcherAssert.assertThat(
101101
String.format(
102102
"OyRemote with narrow hash should have contained program %s, but it didn't",
@@ -114,7 +114,7 @@ void checksPresenceOfProgramWithNarrowHash() throws IOException {
114114
@Test
115115
@ExtendWith(WeAreOnline.class)
116116
void checksPresenceOfDirectoryWithNarrowHash() throws IOException {
117-
final String stdout = "org.eolang.ss";
117+
final String stdout = "ss";
118118
MatcherAssert.assertThat(
119119
String.format(
120120
"OyRemote with narrow hash should have contained directory %s, but it didn't",

eo-runtime/pom.xml

Lines changed: 155 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,162 @@
265265
<skipProgramLints>
266266
<lint>inconsistent-args</lint>
267267
</skipProgramLints>
268+
<!--
269+
@todo #4987:30min. Reduce keepBinaries back to package-info entries only.
270+
Due to incorrect default value of classesDir in MjSafe (fixed in #4987),
271+
MjUnplace and MjUnspile were not working properly, so all classes —
272+
hand-written, generated, and placed — were published to Maven Central by
273+
mistake (see #4538). As a result, when eo-runtime resolves itself as a
274+
dependency, all those extra classes get placed into target/classes and
275+
would be included in the JAR unless explicitly kept here. Once a release
276+
with the fix is published to Maven Central and this module stops resolving
277+
the bloated artifact, this list can be reduced back to the five
278+
package-info.class entries.
279+
-->
268280
<keepBinaries>
269-
<glob>EOorg/package-info.class</glob>
270-
<glob>EOorg/EOeolang/package-info.class</glob>
271-
<glob>EOorg/EOeolang/EOfs/package-info.class</glob>
272-
<glob>EOorg/EOeolang/EOms/package-info.class</glob>
273-
<glob>EOorg/EOeolang/EOsm/package-info.class</glob>
274-
<glob>EOorg/EOeolang/EOtt/package-info.class</glob>
281+
<glob>org/eolang/AtComposite.class</glob>
282+
<glob>org/eolang/Atom.class</glob>
283+
<glob>org/eolang/AtomSafe.class</glob>
284+
<glob>org/eolang/AtOnce.class</glob>
285+
<glob>org/eolang/AtRho.class</glob>
286+
<glob>org/eolang/Attr.class</glob>
287+
<glob>org/eolang/AtVoid.class</glob>
288+
<glob>org/eolang/AtWithRho.class</glob>
289+
<glob>org/eolang/Bytes.class</glob>
290+
<glob>org/eolang/BytesOf.class</glob>
291+
<glob>org/eolang/BytesRaw.class</glob>
292+
<glob>org/eolang/Data.class</glob>
293+
<glob>org/eolang/Dataized.class</glob>
294+
<glob>org/eolang/EObytes$EOand.class</glob>
295+
<glob>org/eolang/EObytes$EOconcat.class</glob>
296+
<glob>org/eolang/EObytes$EOeq.class</glob>
297+
<glob>org/eolang/EObytes$EOnot.class</glob>
298+
<glob>org/eolang/EObytes$EOor.class</glob>
299+
<glob>org/eolang/EObytes$EOright.class</glob>
300+
<glob>org/eolang/EObytes$EOsize.class</glob>
301+
<glob>org/eolang/EObytes$EOslice.class</glob>
302+
<glob>org/eolang/EObytes$EOxor.class</glob>
303+
<glob>org/eolang/EOerror.class</glob>
304+
<glob>org/eolang/EOfs/EOdir$EOmade$EOmkdir.class</glob>
305+
<glob>org/eolang/EOfs/EOdir$EOtmpfile$EOtouch.class</glob>
306+
<glob>org/eolang/EOfs/EOdir$EOwalk.class</glob>
307+
<glob>org/eolang/EOfs/EOfile$EOdeleted$EOdelete.class</glob>
308+
<glob>org/eolang/EOfs/EOfile$EOexists.class</glob>
309+
<glob>org/eolang/EOfs/EOfile$EOis_directory.class</glob>
310+
<glob>org/eolang/EOfs/EOfile$EOmoved$EOmove.class</glob>
311+
<glob>org/eolang/EOfs/EOfile$EOopen$EOfile_stream$EOread$EOchunk.class</glob>
312+
<glob>org/eolang/EOfs/EOfile$EOopen$EOfile_stream$EOwrite$EOwritten_bytes.class</glob>
313+
<glob>org/eolang/EOfs/EOfile$EOopen$EOprocess_file.class</glob>
314+
<glob>org/eolang/EOfs/EOfile$EOsize.class</glob>
315+
<glob>org/eolang/EOfs/EOfile$EOtouched$EOtouch.class</glob>
316+
<glob>org/eolang/EOfs/Files.class</glob>
317+
<glob>org/eolang/EOfs/package-info.class</glob>
318+
<glob>org/eolang/EOi16$EOas_i32.class</glob>
319+
<glob>org/eolang/EOi32$EOas_i64.class</glob>
320+
<glob>org/eolang/EOi64$EOas_number.class</glob>
321+
<glob>org/eolang/EOi64$EOdiv.class</glob>
322+
<glob>org/eolang/EOi64$EOgt.class</glob>
323+
<glob>org/eolang/EOi64$EOplus.class</glob>
324+
<glob>org/eolang/EOi64$EOtimes.class</glob>
325+
<glob>org/eolang/EOmalloc$EOof$EOφ.class</glob>
326+
<glob>org/eolang/EOmalloc$EOof$EOallocated$EOread.class</glob>
327+
<glob>org/eolang/EOmalloc$EOof$EOallocated$EOresized.class</glob>
328+
<glob>org/eolang/EOmalloc$EOof$EOallocated$EOsize.class</glob>
329+
<glob>org/eolang/EOmalloc$EOof$EOallocated$EOwrite.class</glob>
330+
<glob>org/eolang/EOms/EOacos.class</glob>
331+
<glob>org/eolang/EOms/EOangle$EOcos.class</glob>
332+
<glob>org/eolang/EOms/EOangle$EOsin.class</glob>
333+
<glob>org/eolang/EOms/EOasin.class</glob>
334+
<glob>org/eolang/EOms/EOln.class</glob>
335+
<glob>org/eolang/EOms/EOpow.class</glob>
336+
<glob>org/eolang/EOms/EOsqrt.class</glob>
337+
<glob>org/eolang/EOms/package-info.class</glob>
338+
<glob>org/eolang/EOnumber$EOas_i64.class</glob>
339+
<glob>org/eolang/EOnumber$EOdiv.class</glob>
340+
<glob>org/eolang/EOnumber$EOfloor.class</glob>
341+
<glob>org/eolang/EOnumber$EOgt.class</glob>
342+
<glob>org/eolang/EOnumber$EOplus.class</glob>
343+
<glob>org/eolang/EOnumber$EOtimes.class</glob>
344+
<glob>org/eolang/EOsm/EOos$EOname.class</glob>
345+
<glob>org/eolang/EOsm/EOposix$EOφ.class</glob>
346+
<glob>org/eolang/EOsm/EOwin32$EOφ.class</glob>
347+
<glob>org/eolang/EOsm/package-info.class</glob>
348+
<glob>org/eolang/EOsm/Posix/AcceptSyscall.class</glob>
349+
<glob>org/eolang/EOsm/Posix/BindSyscall.class</glob>
350+
<glob>org/eolang/EOsm/Posix/CloseSyscall.class</glob>
351+
<glob>org/eolang/EOsm/Posix/ConnectSyscall.class</glob>
352+
<glob>org/eolang/EOsm/Posix/CStdLib.class</glob>
353+
<glob>org/eolang/EOsm/Posix/ErrnoSyscall.class</glob>
354+
<glob>org/eolang/EOsm/Posix/GetenvSyscall.class</glob>
355+
<glob>org/eolang/EOsm/Posix/GetpidSyscall.class</glob>
356+
<glob>org/eolang/EOsm/Posix/GettimeofdaySyscall.class</glob>
357+
<glob>org/eolang/EOsm/Posix/InetAddrSyscall.class</glob>
358+
<glob>org/eolang/EOsm/Posix/ListenSyscall.class</glob>
359+
<glob>org/eolang/EOsm/Posix/package-info.class</glob>
360+
<glob>org/eolang/EOsm/Posix/ReadSyscall.class</glob>
361+
<glob>org/eolang/EOsm/Posix/RecvSyscall.class</glob>
362+
<glob>org/eolang/EOsm/Posix/SendSyscall.class</glob>
363+
<glob>org/eolang/EOsm/Posix/SocketSyscall.class</glob>
364+
<glob>org/eolang/EOsm/Posix/StrerrorSyscall.class</glob>
365+
<glob>org/eolang/EOsm/Posix/WriteSyscall.class</glob>
366+
<glob>org/eolang/EOsm/SockaddrIn.class</glob>
367+
<glob>org/eolang/EOsm/Syscall.class</glob>
368+
<glob>org/eolang/EOsm/TupleToArray.class</glob>
369+
<glob>org/eolang/EOsm/Win32/AcceptFuncCall.class</glob>
370+
<glob>org/eolang/EOsm/Win32/BaseTSD.class</glob>
371+
<glob>org/eolang/EOsm/Win32/BindFuncCall.class</glob>
372+
<glob>org/eolang/EOsm/Win32/ClosesocketFuncCall.class</glob>
373+
<glob>org/eolang/EOsm/Win32/ConnectFuncCall.class</glob>
374+
<glob>org/eolang/EOsm/Win32/GetCurrentProcessIdFuncCall.class</glob>
375+
<glob>org/eolang/EOsm/Win32/GetEnvironmentVariableFuncCall.class</glob>
376+
<glob>org/eolang/EOsm/Win32/GetSystemTimeFuncCall.class</glob>
377+
<glob>org/eolang/EOsm/Win32/InetAddrFuncCall.class</glob>
378+
<glob>org/eolang/EOsm/Win32/Kernel32.class</glob>
379+
<glob>org/eolang/EOsm/Win32/ListenFuncCall.class</glob>
380+
<glob>org/eolang/EOsm/Win32/package-info.class</glob>
381+
<glob>org/eolang/EOsm/Win32/ReadFileFuncCall.class</glob>
382+
<glob>org/eolang/EOsm/Win32/RecvFuncCall.class</glob>
383+
<glob>org/eolang/EOsm/Win32/SendFuncCall.class</glob>
384+
<glob>org/eolang/EOsm/Win32/SocketFuncCall.class</glob>
385+
<glob>org/eolang/EOsm/Win32/WinBase.class</glob>
386+
<glob>org/eolang/EOsm/Win32/Wincon.class</glob>
387+
<glob>org/eolang/EOsm/Win32/WinDef.class</glob>
388+
<glob>org/eolang/EOsm/Win32/WinNT.class</glob>
389+
<glob>org/eolang/EOsm/Win32/Winsock.class</glob>
390+
<glob>org/eolang/EOsm/Win32/WriteFileFuncCall.class</glob>
391+
<glob>org/eolang/EOsm/Win32/WSACleanupFuncCall.class</glob>
392+
<glob>org/eolang/EOsm/Win32/WSAGetLastErrorFuncCall.class</glob>
393+
<glob>org/eolang/EOsm/Win32/WSAStartupFuncCall.class</glob>
394+
<glob>org/eolang/EOtry.class</glob>
395+
<glob>org/eolang/EOtt/EOregex$EOφ.class</glob>
396+
<glob>org/eolang/EOtt/EOregex$EOpattern$EOmatch$EOmatched_from_index.class</glob>
397+
<glob>org/eolang/EOtt/EOsprintf.class</glob>
398+
<glob>org/eolang/EOtt/EOsscanf.class</glob>
399+
<glob>org/eolang/EOtt/package-info.class</glob>
400+
<glob>org/eolang/EOtt/SprintfArgs.class</glob>
401+
<glob>org/eolang/ExAbstract.class</glob>
402+
<glob>org/eolang/ExFailure.class</glob>
403+
<glob>org/eolang/ExInterrupted.class</glob>
404+
<glob>org/eolang/Expect.class</glob>
405+
<glob>org/eolang/ExReadOnly.class</glob>
406+
<glob>org/eolang/ExUnset.class</glob>
407+
<glob>org/eolang/Heaps.class</glob>
408+
<glob>org/eolang/JavaPath.class</glob>
409+
<glob>org/eolang/Main.class</glob>
410+
<glob>org/eolang/package-info.class</glob>
411+
<glob>org/eolang/PhCached.class</glob>
412+
<glob>org/eolang/PhCopy.class</glob>
413+
<glob>org/eolang/PhDefault.class</glob>
414+
<glob>org/eolang/Phi.class</glob>
415+
<glob>org/eolang/PhLogged.class</glob>
416+
<glob>org/eolang/PhMethod.class</glob>
417+
<glob>org/eolang/PhOnce.class</glob>
418+
<glob>org/eolang/PhPackage.class</glob>
419+
<glob>org/eolang/PhSafe.class</glob>
420+
<glob>org/eolang/PhVoid.class</glob>
421+
<glob>org/eolang/PhWith.class</glob>
422+
<glob>org/eolang/VerboseBytesAsString.class</glob>
423+
<glob>org/eolang/XmirObject.class</glob>
275424
</keepBinaries>
276425
</configuration>
277426
</execution>

0 commit comments

Comments
 (0)