Skip to content

Commit

Permalink
Release 1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Pante committed Feb 6, 2022
1 parent 16f7479 commit 71a0512
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 9 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 1.1.2 (06/02/2022)

This is a hotfix for a few issues.

## Elementary
- Fix `Results` returning empty generated files


## 1.1.1 - Polish & Shine (20/06/2021)

This release focuses on fixing a few pesky issues.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ This project is heavily inspired by Google's [compile-testing](https://github.co
<dependency>
<groupId>com.karuslabs</groupId>
<artifactId>elementary</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
<scope>test</scope>
</dependency>
```
Expand All @@ -54,7 +54,7 @@ This project is heavily inspired by Google's [compile-testing](https://github.co
<dependency>
<groupId>com.karuslabs</groupId>
<artifactId>satisfactory</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
</dependency>
```

Expand All @@ -68,6 +68,6 @@ This project is heavily inspired by Google's [compile-testing](https://github.co
<dependency>
<groupId>com.karuslabs</groupId>
<artifactId>satisfactory</artifactId>
<version>1.1.1/version>
<version>1.1.2/version>
</dependency>
```
2 changes: 1 addition & 1 deletion elementary/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.karuslabs</groupId>
<artifactId>elementary-project</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
</parent>

<artifactId>elementary</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ public Results compile(Iterable<? extends JavaFileObject> files) {

var task = compiler.getTask(null, manager, diagnostics, options, null, files);
task.setProcessors(processors);
var success = task.call();

return new Results(manager.outputFiles(), manager.generatedSources(), diagnostics, task.call());
return new Results(manager.outputFiles(), manager.generatedSources(), diagnostics, success);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,22 @@
*/
package com.karuslabs.elementary;

import com.karuslabs.utilitary.AnnotationProcessor;

import java.io.*;
import java.net.*;
import java.util.*;
import java.util.logging.*;
import javax.annotation.processing.*;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.TypeElement;
import javax.tools.*;

import org.junit.jupiter.api.*;

import static com.karuslabs.elementary.Compiler.javac;
import static com.karuslabs.elementary.file.FileObjects.*;
import static javax.lang.model.SourceVersion.latest;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;

Expand Down Expand Up @@ -59,6 +66,13 @@ void processors_collection() {
}


@Test
void processors_generated_files() {
var results = javac().processors(List.of(new GeneratorProcessor())).compile(DUMMY);
assertEquals(1, results.generated.size());
}


@Test
void options_varargs() throws IOException, URISyntaxException {
var results = javac().options("-nowarn").processors(new WarningProcessor()).compile(DUMMY);
Expand Down Expand Up @@ -111,4 +125,27 @@ void classpath_files() throws URISyntaxException {
assertEquals("package org.checkerframework.checker.nullness.qual does not exist", results.find().list().get(0).getMessage(Locale.ENGLISH));
}

}


@SupportedAnnotationTypes({"*"})
class GeneratorProcessor extends AnnotationProcessor {
@Override
public boolean process(Set<? extends TypeElement> set, RoundEnvironment round) {
if (round.processingOver()) {
try {
processingEnv.getFiler().createSourceFile("GeneratedFile", elements.getTypeElement("java.util.ArrayList"));

} catch (IOException ex) {
return false;
}
}

return false;
}

@Override
public SourceVersion getSupportedSourceVersion() {
return latest();
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.karuslabs</groupId>
<artifactId>elementary-project</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
<packaging>pom</packaging>

<name>Elementary Project</name>
Expand Down
2 changes: 1 addition & 1 deletion satisfactory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.karuslabs</groupId>
<artifactId>elementary-project</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
</parent>

<artifactId>satisfactory</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions utilitary/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.karuslabs</groupId>
<artifactId>elementary-project</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
</parent>
<artifactId>utilitary</artifactId>
<packaging>jar</packaging>
Expand All @@ -26,7 +26,7 @@
<path>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<version>1.0-rc6</version>
<version>1.0.1</version>
</path>
</annotationProcessorPaths>
</configuration>
Expand Down

0 comments on commit 71a0512

Please sign in to comment.