v2022.1.5
Release v2022.1.5
Java 17 Support
- Manifold fully supports Java 17 and Java 18 (Early Access)
- Support extensions on record classes
IntelliJ IDEA & Android Studio plugin improvements
- Many performance improvements and bug fixes toward an improved user experience in the IDE
Update for ManTL Templates
- Fix rendering issues relating to recent IntelliJ IDEA platform changes. Other minor improvements.
Improvements for Structural Interfaces
- Support structural interface implementation via Extension Class without having to manually create an IProxyFactory service impl. A powerful feature for overlaying APIs onto external systems.
- Support operator overloading via default interface methods in structural interface
- Support proxies on a structural interface with default methods with ReflectUtil.invokeDefault()
Improvements for Preprocessor
- Implement the
SymbolProvider
SPI to augment the environment definitions with your own custom environment symbols. - Improved Android support:
The manifold-preprocessor-android-syms
library implements the service to provide direct access to
Android build variant symbols. You can add the library as a dependency to gain automatic access to familiar Android
BuildConfig
symbols:
DEBUG
BUILD_TYPE // current build variant
FLAVOR // flavor of current build variant
etc.
See manifold-preprocessor-android-syms for details.
Improvements for GraphQL
- GraphQL generated code is less than 1/2 of its previous size. No API changes.
- Added support for processing the raw GraphQL response to access custom key/value pairs etc.
- Support multiple GraphQL schemas using .graphqlconfig files
Support dumping source
Manifold integrates directly with the Java parser, as such there are no intermediate files to manage. However,
some tools may need to parse or otherwise analyze processed Java source separate from the Java compiler. In this case
you can use the manifold.source.target
compiler option to specify a directory where all source is copied as it is
compiled, including preprocessed and generated source from Manifold.
Usage:
javac -Amanifold.source.target=<my-directory> ...
Bug fixes
- #341 change strategy to address jdk12+ member filtering
- #338 fix ManTL template issues that have piled up with recent JetBrains platform updates
- #337 Support structural interface implementation via Extension Class without having to manually create an IProxyFactory service impl
- #336 IntelliJ plugin: performing a clean build from maven/gradle tool causes perpetual refresh in UI
- #334 handle case with ReflectUtil.invokeDefault() where the receiving default method has param type that is a structural interface
- #333 handle structural overload operator methods
- #332 fix issues with operator overloading relating to structural interfaces
- #330 NPE in IntelliJ inside fileOpenedSync() when manifold-props not in use
- #329 'Array index out of bounds' warning highlight in IJ editor for indexed access to Maps
- #328 editing a graphql file in IntelliJ causes some graphql types not to resolve
- #327 fix conflict with preprocessor build.properties and environment symbols
- #326 Add a preprocessor SymbolProvider implementation for Android build variants
- #325 Building on Android Studio with Gradle 7.0.3 and Java 11 causes internal compiler errors
- #324 fix general lag in IJ editor after typing
- #322 Add an SPI to augment the preprocessor's symbols dynamically
- #319 Fix IJ plugin regarding manifold preprocessor when only the preprocessor is in use
- #313 Fix default parameter values for graphql operations
- #311 IJ plugin: Fix psi cache exception caused by intellij internals using WrappedLexer
- #306 Support Java 17
- #303 GQL Fields with Underscores producing incorrectly in 2021.1.23
- #302 "Access is allowed from event dispatch thread only" exception thrown occasionally in IntelliJ
- #301 GraphQL: Slim down generated source
- #300 CCE at runtime when structural interface having a method that returns a structural interface
- #297 IJ plugin: Some features of manifold-ext and manifold-props leak through to modules not depending on these artifacts, in such cases avoid applying these code paths
- #296 AbstractMethodError using property syntax in an interface default method
- #295 Support compiler option to dump [pre]processed and/or generated manifold sources to disk
- #292 Compile with Java Operator Overloading inc() dec() error
- #290 IJ plugin: Improve performance while editing, particularly where code completion involves manifold extensions, also avoid irrelevant code paths where possible e.g., type resolution involving manifold-ext where it is not used
- #288 Incompatible types. required: 'manifold.rt.api.anno.any[]'
- #286 Access is allowed from event dispatch thread only
- #285 Sometimes causes code analysis failure
- #284 IJ plugin: NullPointerException breaks menu items and Quick Fix suggestion
- #283 Switch on Enum is probably broken IntelliJ Plugin
- #282 Manifold incompatible with Lombok val/var locals
- #281 IntelliJ 2021.2 Community Edition: Null Ptr Exceptions
- #279 GraphQL: Bearer Authorization broken when calling graphQL server
- #277 GraphQL: Add support for processing the raw GraphQL response to access custom key/value pairs etc.
- #276 manifold-graphql: support a built-in "JSON" scalar
- #273 IJ plugin: revise logic for protected property access
- #270 don't pollute compiler output with warnings from generated code, particularly relevant with
-Xlint:all
usage - #268 manifold-strings: provide javac command line option to exclude simple
$foo
syntax from processing while still allowing${foo}
- #260 support extensions on record classes
- #255 Fix issues with JDK 16 compatibility and manifold-props
- #254 Inferred property silently shadows local captured reference from anonymous context
- #253 using manifold-props with AWT/Swing app, cannot find symbols in sun.awt.util
- #173 Fix race condition
- #101 Support multiple GraphQL schemas using .graphqlconfig files
Release v2021.1.8
Properties
The manifold-props
project is a compiler plugin to simplify declaring and using properties in Java. Use it to reduce
the amount of code you would otherwise write and to improve your overall dev experience with properties.
public interface Book {
@var String title; // no more boilerplate code!
}
// refer to it directly by name
book.title = "Daisy"; // calls setter
String name = book.title; // calls getter
book.title += " chain"; // calls getter & setter
Additionally, manifold-props
automatically infers properties, both from your existing source files and from
compiled classes your project uses.
java.time.ZonedDateTime zdt = ZonedDateTime.now();
String calendarType = zdt.chronology.calendarType; // access properties concisely & consistently throughout yor project
See Property inference.
Properties are fully integrated in both IntelliJ IDEA and Android Studio. Use the IDE's features to create new
properties, verify property references, access properties with code completion, and more.
Additional operator overloading support for:
- prefix/postfix increment/decrement operators
++
and--
- compound assignment: operators
+=
,-=
,*=
,/=
,%=
, - index operator
[]
, both access and assignment
Please see Operator Overloading documentation for details.
Additional support for Structural Interfaces
- support structural interfaces dynamically without having manifold-ext dependency at runtime. See #240.
Unit expressions improvements
New and
binding constant:
- use with
Pair
class to simplify syntax:
Pair<String, Integer> pair = "Moe" and 100;
- add
Map#mapOf
extension method:
Map<String, Integer> scores = mapOf("Moe" and 100, "Larry" and 107, "Curly" and 111);
Preprocessor improvements
- support relational expressions in the preprocessor. See #204.
Extension method improvements
- add support for extension classes on Java's array type. See Extending Arrays.
Java 16 support
- Adapt to API changes and changes resulting from JEP 396: Strongly Encapsulate JDK Internals by Default.
Release v2020.1.19
Android Studio Support
Manifold now fully supports Android Studio. Please see Android Setup to
learn more.
Kotlin Support
Use Manifold with Kotlin and other JVM languages! Please see Kotlin Support to
learn more.
Support Java 6 & 7
Manifold now supports Java -source
and -target
versions prior to 8 with core features and most extensions including
manifold-preprocessor.
For instance, using manifold-preprocessor
you can use builtin definitions like this:
#if JAVA_6
public String perform() {
return "java6";
}
#elif JAVA_7
public String perform() {
return "java7";
}
#elif JAVA_8_OR_LATER
public String perform() {
return "at least java8";
}
#endif
Notes:
- Although Manifold supports -source and -target levels below 8, you must use a Java 8 or later compiler in your build
- Some type manifolds such as manifold-graphql and manifold-json are not supported with -source levels below 8
Pure Static Compilation
Manifold dependencies are now separated into compile-only and API (or implementation) modules. This change allows
projects to limit Manifold's compilation features to compile-time and eliminate most of Manifold's footprint from
runtime. This change is also at the heart of Manifold's support for Android and Kotlin.
Explicit Compilation
Similar to javac's source file list, Manifold provides -Amanifold.source.<ext>=<regex>
javac command line options to
explicitly compile resources either by type name using regular expressions or by file name using file system paths.
See the Sample Kotlin App for an example of using
explicit resource compilation.
Release v2019.1.29
Type-safe CSV Support
Comprehensive support for CSV, interchangeable with JSON, XML, and YAML.
// Type-safely use a CSV file in your resource directory, no code gen
import com.example.MyCsvData; // from resource file: com/example/MyCsvData.csv
import com.example.MyCsvData.MyCsvDataItem;
...
// Load data from the resource file
MyCsvData dataItems = MyCsvData.fromSource();
// Access rows of data type-safely
for (MyCsvData.MyCsvDataItem item: dataItems) {
String name = item.getLastName();
LocalDateTime startDate = item.getStartDate();
...
}
Type-safe XML Support
Comprehensive support for XML, interchangeable with JSON, YAML, and CSV.
// Type-safely use an XML file in your resource directory
import com.example.config.MyXmlConfig;
...
// Load data from the resource file
MyXmlConfig config = MyXmlConfig.fromSource();
// Access elements/attributes type-safely
var linesOfBusiness = config.getEnvironment().getLinesOfBusiness();
...
Release v2019.1.21
Operator Overloading
Implement operator methods on any type to directly support arithmetic, relational, and unit operators.
// BigDecimal expressions
if (bigDec1 > bigDec2) {
BigDecimal result = bigDec1 + bigDec2;
...
}
// Implemnet operators for any type
MyType value = myType1 + myType2;
Unit Expressions
Unit or binding operations are unique to the Manifold framework. They provide a powerfully concise syntax and can be applied to a wide range of applications.
import static manifold.science.util.UnitConstants.*; // kg, m, s, ft, etc
...
Length distance = 100 mph * 3 hr;
Force f = 5.2 kg m/s/s; // same as 5.2 N
Mass infant = 9 lb + 8.71 oz;
Ranges
Easily work with the Range
API using unit expressions. Simply import the RangeFun
constants to create ranges.
// imports the `to`, `step`, and other "binding" constants
import static manifold.collections.api.range.RangeFun.*;
...
for (int i: 1 to 5) {
out.println(i);
}
for (Mass m: 0kg to 10kg step 22r unit g) {
out.println(m);
}
Science
Use the manifold-science framework to type-safely incorporate units and precise measurements into your applications.
import static manifold.science.util.UnitConstants.*; // kg, m, s, ft, etc.
...
Velocity rate = 65mph;
Time time = 1min + 3.7sec;
Length distance = rate * time;