Skip to content

Commit

Permalink
fix CompileModuleInfo task
Browse files Browse the repository at this point in the history
  • Loading branch information
Glavo committed Apr 11, 2022
1 parent 3ddc6ac commit 89cdd17
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ Maven:
<dependency>
<groupId>org.glavo</groupId>
<artifactId>module-info-compiler</artifactId>
<version>1.1</version>
<version>1.2</version>
</dependency>
```

Gradle:

```kotlin
implementation("org.glavo:module-info-compiler:1.1")
implementation("org.glavo:module-info-compiler:1.2")
```
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ allprojects {
}

group = "org.glavo"
version = "1.1"// + "-SNAPSHOT"
version = "1.2"// + "-SNAPSHOT"

repositories {
mavenCentral()
Expand Down
16 changes: 7 additions & 9 deletions src/main/java/org/glavo/mic/tasks/CompileModuleInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,16 @@
import org.glavo.mic.ModuleInfoCompiler;
import org.gradle.api.DefaultTask;
import org.gradle.api.file.RegularFileProperty;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.InputFile;
import org.gradle.api.tasks.OutputFile;
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.*;

import java.io.*;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;

public abstract class CompileModuleInfo extends DefaultTask {
private int targetCompatibility = ModuleInfoCompiler.DEFAULT_TARGET_COMPATIBILITY;
private String moduleVersion;
private String moduleMainClass;
private Charset encoding = StandardCharsets.UTF_8;
private String encoding = "UTF-8";

@InputFile
public abstract RegularFileProperty getSourceFile();
Expand All @@ -35,6 +30,7 @@ public void setTargetCompatibility(int targetCompatibility) {
}

@Input
@Optional
public String getModuleVersion() {
return moduleVersion;
}
Expand All @@ -44,6 +40,7 @@ public void setModuleVersion(String moduleVersion) {
}

@Input
@Optional
public String getModuleMainClass() {
return moduleMainClass;
}
Expand All @@ -53,11 +50,12 @@ public void setModuleMainClass(String moduleMainClass) {
}

@Input
public Charset getEncoding() {
@Optional
public String getEncoding() {
return encoding;
}

public void setEncoding(Charset encoding) {
public void setEncoding(String encoding) {
this.encoding = encoding;
}

Expand Down

0 comments on commit 89cdd17

Please sign in to comment.