Compare commits

..

18 Commits

Author SHA1 Message Date
Jordan Zimmerman
0abbf3ecd0 [maven-release-plugin] prepare release record-builder-1.16 2021-01-30 07:47:30 -05:00
Jordan Zimmerman
1e8a88b81e Merge pull request #23 from Randgalt/fix-alt-interface-names
Fix alt interface names
2021-01-24 09:11:31 -05:00
Jordan Zimmerman
b53392f910 Merge pull request #22 from Randgalt/java16
Prep for Java 16
2021-01-24 09:11:19 -05:00
Jordan Zimmerman
00bb0940bc Added support for putting @RecordInterface on Java beans 2021-01-21 10:10:01 -05:00
Jordan Zimmerman
e0abb07481 Prep for Java 16 2021-01-16 05:05:12 -05:00
Jordan Zimmerman
8845622540 Create FUNDING.yml 2021-01-12 09:50:27 -05:00
Jordan Zimmerman
f8e56a40f3 Merge pull request #19 from Randgalt/use-with-to-get-builder
Have the consumer version of with() use the other with()
2020-12-21 08:10:32 -05:00
Jordan Zimmerman
5a07cf23f7 Have the consumer version of with() use the other with() to get the builder. This will ensure better testing and is more logical 2020-12-21 08:08:44 -05:00
Jordan Zimmerman
78ba53f96d Merge pull request #18 from Randgalt/patch-1
Use provided/compileOnly instead of implementation
2020-12-21 07:36:38 -05:00
Jordan Zimmerman
0153f65121 you're right - we only need provided/compileOnly. I've made the updates to Maven as well. 2020-12-21 07:12:28 -05:00
Marc Philipp
c1e771bbbe Use compileOnly instead of implementation
Since most users only need the annotations.
2020-12-21 11:43:56 +01:00
Jordan Zimmerman
c9ba514773 [maven-release-plugin] prepare for next development iteration 2020-12-11 19:27:42 -05:00
Jordan Zimmerman
491ed4f6e0 [maven-release-plugin] prepare release record-builder-1.14.ea 2020-12-11 19:27:34 -05:00
Jordan Zimmerman
16751508cc Update README.md 2020-12-11 13:54:05 -05:00
Jordan Zimmerman
ee7f81c7b8 Switch to Github Actions 2020-12-11 13:52:58 -05:00
Jordan Zimmerman
015287608b Update maven.yml 2020-12-11 13:51:51 -05:00
Jordan Zimmerman
467bcc9041 Create maven.yml 2020-12-11 13:50:22 -05:00
Jordan Zimmerman
666bc334ad Merge pull request #16 from mbarbero/master
Stop relying on toString() to detect package name.
2020-12-11 13:39:30 -05:00
11 changed files with 49 additions and 173 deletions

View File

@@ -1,7 +1,7 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Maven Build - Java 16
name: Java CI with Maven
on:
push:

View File

@@ -1,28 +0,0 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Maven Build - Java 15
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 15
- name: Create Maven Directory
run: mkdir -p .mvn/
- name: Create Maven JVM file
run: echo "--enable-preview" > .mvn/jvm.config
- name: Build with Maven
run: mvn -P java15 -B package --file pom.xml

View File

@@ -1,5 +1,5 @@
[![Build Status](https://github.com/Randgalt/record-builder/workflows/Java%20CI%20with%20Maven/badge.svg)](https://github.com/Randgalt/record-builder/actions)
[![Maven Central](https://img.shields.io/maven-central/v/io.soabase.record-builder/record-builder.svg?sort=date)](https://search.maven.org/search?q=g:io.soabase.record-builder%20a:record-builder)
[![Maven Central](https://img.shields.io/maven-central/v/io.soabase.record-builder/record-builder.svg)](https://search.maven.org/search?q=g:io.soabase.record-builder%20a:record-builder)
# RecordBuilder
@@ -22,7 +22,6 @@ _Details:_
- [Generation Via Includes](#generation-via-includes)
- [Usage](#usage)
- [Customizing](#customizing)
- [Java 15 Versions](#java-15-versions)
## RecordBuilder Example
@@ -362,77 +361,3 @@ Alternatively, you can provide values for each individual meta data (or combinat
- `javac ... -AfileComment=foo`
- `javac ... -AfileIndent=foo`
- `javac ... -AprefixEnclosingClassNames=foo`
## Java 15 Versions
Artifacts compiled wth Java 15 are available. They are the same versions
as the Java 16 versions with `-java15` appended.
Note: records are a preview feature only in Java 15. You'll need take a number of steps in order to try RecordBuilder:
- Install and make active Java 15 or later
- Make sure your development tool is using Java 15 or later and is configured to enable preview features (for Maven I've documented how to do this here: [https://stackoverflow.com/a/59363152/2048051](https://stackoverflow.com/a/59363152/2048051))
- Bear in mind that this is not yet meant for production and there are numerous bugs in the tools and JDKs.
Note: I've seen some very odd compilation bugs with the current Java 15 and Maven. If you get internal Javac errors I suggest rebuilding with `mvn clean package` and/or `mvn clean install`.
You will need to enable preview in your build tools:
### Maven
```
<dependencies>
<dependency>
<groupId>io.soabase.record-builder</groupId>
<artifactId>record-builder-core</artifactId>
<version>record-builder-version-java15</version>
</dependency>
</dependencies>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>maven-compiler-version</version>
<configuration>
<annotationProcessorPaths>
<annotationProcessorPath>
<groupId>io.soabase.record-builder</groupId>
<artifactId>record-builder-processor</artifactId>
<version>record-builder-version-java15</version>
</annotationProcessorPath>
</annotationProcessorPaths>
<annotationProcessors>
<annotationProcessor>io.soabase.recordbuilder.processor.RecordBuilderProcessor</annotationProcessor>
</annotationProcessors>
<!-- "release" and "enable-preview" are required while records are preview features -->
<release>15</release>
<compilerArgs>
<arg>--enable-preview</arg>
</compilerArgs>
... any other options here ...
</configuration>
</plugin>
```
Create a file in your project's root named `.mvn/jvm.config`. The file should have 1 line with the value: `--enable-preview`. (see: https://stackoverflow.com/questions/58023240)
### Gradle
```
dependencies {
annotationProcessor 'io.soabase.record-builder:record-builder-processor:$record-builder-version-java15'
compileOnly 'io.soabase.record-builder:record-builder-core:$record-builder-version-java15'
}
tasks.withType(JavaCompile) {
options.fork = true
options.forkOptions.jvmArgs += '--enable-preview'
options.compilerArgs += '--enable-preview'
}
tasks.withType(Test) {
jvmArgs += "--enable-preview"
}
```

View File

@@ -1,22 +0,0 @@
#!/usr/bin/env bash
#
# Copyright 2019 Jordan Zimmerman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
jenv local 15
javahome
mkdir -p .mvn/
echo "--enable-preview" > .mvn/jvm.config

View File

@@ -1,21 +0,0 @@
#!/usr/bin/env bash
#
# Copyright 2019 Jordan Zimmerman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
jenv local 16-ea
javahome
rm -fr .mvn

20
pom.xml
View File

@@ -5,7 +5,7 @@
<groupId>io.soabase.record-builder</groupId>
<artifactId>record-builder</artifactId>
<packaging>pom</packaging>
<version>1.19</version>
<version>1.16</version>
<modules>
<module>record-builder-core</module>
@@ -18,8 +18,6 @@
<project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<enable-preview />
<jdk-version>16</jdk-version>
<maven-compiler-plugin-version>3.8.1</maven-compiler-plugin-version>
@@ -73,7 +71,7 @@
<url>https://github.com/randgalt/record-builder</url>
<connection>scm:git:https://github.com/randgalt/record-builder.git</connection>
<developerConnection>scm:git:git@github.com:randgalt/record-builder.git</developerConnection>
<tag>record-builder-1.19</tag>
<tag>record-builder-1.16</tag>
</scm>
<issueManagement>
@@ -125,9 +123,6 @@
<version>${maven-compiler-plugin-version}</version>
<configuration>
<release>${jdk-version}</release>
<compilerArgs>
<arg>${enable-preview}</arg>
</compilerArgs>
</configuration>
</plugin>
@@ -279,9 +274,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin-version}</version>
<configuration>
<argLine>${enable-preview}</argLine>
</configuration>
</plugin>
</plugins>
</pluginManagement>
@@ -344,13 +336,5 @@
</plugins>
</build>
</profile>
<profile>
<id>java15</id>
<properties>
<jdk-version>15</jdk-version>
<enable-preview>--enable-preview</enable-preview>
</properties>
</profile>
</profiles>
</project>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>io.soabase.record-builder</groupId>
<artifactId>record-builder</artifactId>
<version>1.19</version>
<version>1.16</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -0,0 +1,19 @@
/**
* Copyright 2019 Jordan Zimmerman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module io.soabase.record.builder.core {
exports io.soabase.recordbuilder.core;
opens io.soabase.recordbuilder.core;
}

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>io.soabase.record-builder</groupId>
<artifactId>record-builder</artifactId>
<version>1.19</version>
<version>1.16</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -0,0 +1,23 @@
/**
* Copyright 2019 Jordan Zimmerman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module io.soabase.record.builder.processor {
requires com.squareup.javapoet;
requires io.soabase.record.builder.core;
requires java.compiler;
exports io.soabase.recordbuilder.processor;
opens io.soabase.recordbuilder.processor;
}

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>io.soabase.record-builder</groupId>
<artifactId>record-builder</artifactId>
<version>1.19</version>
<version>1.16</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -43,10 +43,6 @@
<annotationProcessors>
<annotationProcessor>io.soabase.recordbuilder.processor.RecordBuilderProcessor</annotationProcessor>
</annotationProcessors>
<release>${jdk-version}</release>
<compilerArgs>
<arg>${enable-preview}</arg>
</compilerArgs>
</configuration>
</plugin>