mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 22:10:54 +03:00
IntelliJ Themes: added Java 9 module descriptor to flatlaf-intellij-themes-<version>.jar
This commit is contained in:
@@ -11,6 +11,8 @@ FlatLaf Change Log
|
|||||||
other themes.
|
other themes.
|
||||||
- IntelliJ Themes: Material UI Lite themes did not work when using
|
- IntelliJ Themes: Material UI Lite themes did not work when using
|
||||||
[IntelliJ Themes Pack](flatlaf-intellij-themes) addon. (PR #88, issue #89)
|
[IntelliJ Themes Pack](flatlaf-intellij-themes) addon. (PR #88, issue #89)
|
||||||
|
- IntelliJ Themes: Added Java 9 module descriptor to
|
||||||
|
`flatlaf-intellij-themes-<version>.jar`.
|
||||||
|
|
||||||
|
|
||||||
## 0.32
|
## 0.32
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public class IntelliJTheme
|
|||||||
* Using a buffered input stream is not necessary.
|
* Using a buffered input stream is not necessary.
|
||||||
*/
|
*/
|
||||||
public static FlatLaf createLaf( InputStream in )
|
public static FlatLaf createLaf( InputStream in )
|
||||||
throws IOException, ParseException
|
throws IOException
|
||||||
{
|
{
|
||||||
return createLaf( new IntelliJTheme( in ) );
|
return createLaf( new IntelliJTheme( in ) );
|
||||||
}
|
}
|
||||||
@@ -106,11 +106,13 @@ public class IntelliJTheme
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings( "unchecked" )
|
@SuppressWarnings( "unchecked" )
|
||||||
public IntelliJTheme( InputStream in )
|
public IntelliJTheme( InputStream in )
|
||||||
throws IOException, ParseException
|
throws IOException
|
||||||
{
|
{
|
||||||
Map<String, Object> json;
|
Map<String, Object> json;
|
||||||
try( Reader reader = new InputStreamReader( in, StandardCharsets.UTF_8 ) ) {
|
try( Reader reader = new InputStreamReader( in, StandardCharsets.UTF_8 ) ) {
|
||||||
json = (Map<String, Object>) Json.parse( reader );
|
json = (Map<String, Object>) Json.parse( reader );
|
||||||
|
} catch( ParseException ex ) {
|
||||||
|
throw new IOException( ex.getMessage(), ex );
|
||||||
}
|
}
|
||||||
|
|
||||||
name = (String) json.get( "name" );
|
name = (String) json.get( "name" );
|
||||||
|
|||||||
@@ -25,6 +25,18 @@ dependencies {
|
|||||||
implementation( project( ":flatlaf-core" ) )
|
implementation( project( ":flatlaf-core" ) )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) {
|
||||||
|
sourceSets {
|
||||||
|
create( "module-info" ) {
|
||||||
|
java {
|
||||||
|
// include "src/main/java" here to get compile errors if classes are
|
||||||
|
// used from other modules that are not specified in module dependencies
|
||||||
|
setSrcDirs( listOf( "src/main/module-info", "src/main/java" ) )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
assemble {
|
assemble {
|
||||||
dependsOn(
|
dependsOn(
|
||||||
@@ -33,6 +45,26 @@ tasks {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) {
|
||||||
|
named<JavaCompile>( "compileModuleInfoJava" ) {
|
||||||
|
sourceCompatibility = "9"
|
||||||
|
targetCompatibility = "9"
|
||||||
|
|
||||||
|
dependsOn( ":flatlaf-core:jar" )
|
||||||
|
|
||||||
|
options.compilerArgs.add( "--module-path" )
|
||||||
|
options.compilerArgs.add( project( ":flatlaf-core" ).tasks["jar"].outputs.files.asPath )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
jar {
|
||||||
|
if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) {
|
||||||
|
from( sourceSets["module-info"].output ) {
|
||||||
|
include( "module-info.class" )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
javadoc {
|
javadoc {
|
||||||
options {
|
options {
|
||||||
this as StandardJavadocDocletOptions
|
this as StandardJavadocDocletOptions
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import java.util.logging.Level;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import com.formdev.flatlaf.FlatLaf;
|
import com.formdev.flatlaf.FlatLaf;
|
||||||
import com.formdev.flatlaf.IntelliJTheme;
|
import com.formdev.flatlaf.IntelliJTheme;
|
||||||
import com.formdev.flatlaf.json.ParseException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
@@ -34,7 +33,7 @@ class Utils
|
|||||||
try {
|
try {
|
||||||
return new IntelliJTheme( Utils.class.getResourceAsStream(
|
return new IntelliJTheme( Utils.class.getResourceAsStream(
|
||||||
"/com/formdev/flatlaf/intellijthemes/themes/" + name ) );
|
"/com/formdev/flatlaf/intellijthemes/themes/" + name ) );
|
||||||
} catch( ParseException | IOException ex ) {
|
} catch( IOException ex ) {
|
||||||
String msg = "FlatLaf: Failed to load IntelliJ theme '" + name + "'";
|
String msg = "FlatLaf: Failed to load IntelliJ theme '" + name + "'";
|
||||||
LOG.log( Level.SEVERE, msg, ex );
|
LOG.log( Level.SEVERE, msg, ex );
|
||||||
throw new RuntimeException( msg, ex );
|
throw new RuntimeException( msg, ex );
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import java.util.logging.Level;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import com.formdev.flatlaf.FlatLaf;
|
import com.formdev.flatlaf.FlatLaf;
|
||||||
import com.formdev.flatlaf.IntelliJTheme;
|
import com.formdev.flatlaf.IntelliJTheme;
|
||||||
import com.formdev.flatlaf.json.ParseException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
@@ -34,7 +33,7 @@ class Utils
|
|||||||
try {
|
try {
|
||||||
return new IntelliJTheme( Utils.class.getResourceAsStream(
|
return new IntelliJTheme( Utils.class.getResourceAsStream(
|
||||||
"/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/" + name ) );
|
"/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/" + name ) );
|
||||||
} catch( ParseException | IOException ex ) {
|
} catch( IOException ex ) {
|
||||||
String msg = "FlatLaf: Failed to load IntelliJ theme '" + name + "'";
|
String msg = "FlatLaf: Failed to load IntelliJ theme '" + name + "'";
|
||||||
LOG.log( Level.SEVERE, msg, ex );
|
LOG.log( Level.SEVERE, msg, ex );
|
||||||
throw new RuntimeException( msg, ex );
|
throw new RuntimeException( msg, ex );
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2020 FormDev Software GmbH
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
*
|
||||||
|
* https://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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Karl Tauber
|
||||||
|
*/
|
||||||
|
module com.formdev.flatlaf.intellijthemes {
|
||||||
|
requires java.desktop;
|
||||||
|
requires java.logging;
|
||||||
|
requires com.formdev.flatlaf;
|
||||||
|
|
||||||
|
exports com.formdev.flatlaf.intellijthemes;
|
||||||
|
exports com.formdev.flatlaf.intellijthemes.materialthemeuilite;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user