跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[程序员] Java 项目如何实现排除指定文件以及指定文件进行编译

发表于
各位大佬,晚上好
目前遇到一个需求是需要将项目中的文件按照不同的配置进行编译,最后编译出不同的可执行 jar 或者可执行文件;
例如项目中有(base.java, A.java <- A1.java, A.java <- A2.java ,B.java <- B1.java),"<-"表示继承自或实现关系,根据配置 A 构建后的 jar 中就只包含(base.class 、A.class 、A1.class, A2.class)、根据配置 B 构建后的 jar 中就只包含(base.class 、B.class 、B1.class);

目前想到两种解决方案:
1. Gradle 在编译阶段先读取配置文件,然后在将需要排除的文件通过类似"exclude"的方式进行排除,排除后在进行编译;
2. 通过 GraalVM 的 native-image 功能来编译成指定的可执行文件,这一部分不太了解;

各位大佬,有没有了解过相关的解决方案或者思路,感谢.

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.