parent
b41e5397ef
commit
af8e0ee0cc
2
LICENSE
2
LICENSE
|
@ -1,7 +1,7 @@
|
|||
- OS - Information about the system, Java runtime, OS, Window Manager, and Desktop Environment.
|
||||
[The Apache Software License, Version 2.0]
|
||||
https://git.dorkbox.com/dorkbox/OS
|
||||
Copyright 2022
|
||||
Copyright 2023
|
||||
Dorkbox LLC
|
||||
|
||||
Extra license information
|
||||
|
|
|
@ -20,7 +20,7 @@ Maven Info
|
|||
<dependency>
|
||||
<groupId>com.dorkbox</groupId>
|
||||
<artifactId>OS</artifactId>
|
||||
<version>1.1</version>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
```
|
||||
|
@ -30,7 +30,7 @@ Gradle Info
|
|||
```
|
||||
dependencies {
|
||||
...
|
||||
implementation("com.dorkbox:OS:1.1")
|
||||
implementation("com.dorkbox:OS:1.2")
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ object Extras {
|
|||
// set for the project
|
||||
const val description = "Information about the system, Java runtime, OS, Window Manager, and Desktop Environment."
|
||||
const val group = "com.dorkbox"
|
||||
const val version = "1.1"
|
||||
const val version = "1.2"
|
||||
|
||||
// set as project.ext
|
||||
const val name = "OS"
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
package dorkbox.os
|
||||
|
||||
internal object JVM {
|
||||
// java 8 cannot use JPMS. We use a multi-release jar to detect the state for java9+ runtimes
|
||||
|
||||
/**
|
||||
* Returns true if the currently running JVM is using the classpath or modules (JPMS)
|
||||
*/
|
||||
var usesJpms = false
|
||||
}
|
|
@ -29,7 +29,7 @@ object OS {
|
|||
/**
|
||||
* Gets the version number.
|
||||
*/
|
||||
const val version = "1.1"
|
||||
const val version = "1.2"
|
||||
|
||||
init {
|
||||
// Add this project to the updates system, which verifies this class + UUID + version information
|
||||
|
@ -43,7 +43,7 @@ object OS {
|
|||
const val LINE_SEPARATOR_MACOS = "\r"
|
||||
const val LINE_SEPARATOR_WINDOWS = "\r\n"
|
||||
|
||||
val TEMP_DIR = File(getProperty("java.io.tmpdir", "temp")).absoluteFile!!
|
||||
val TEMP_DIR = File(getProperty("java.io.tmpdir", "temp")).absoluteFile
|
||||
|
||||
/**
|
||||
* The currently running MAJOR java version as a NUMBER. For example, "Java version 1.7u45", and converts it into 7, uses JEP 223 for java > 9
|
||||
|
@ -74,6 +74,11 @@ object OS {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the currently running JVM is using the classpath or modules (JPMS)
|
||||
*/
|
||||
val usesJpms = JVM.usesJpms
|
||||
|
||||
/**
|
||||
* Returns the *ORIGINAL* system time zone, before (*IF*) it was changed to UTC
|
||||
*/
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
/*
|
||||
* Copyright 2021 dorkbox, llc
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package dorkbox.os;
|
||||
|
||||
/**
|
||||
* Required for intellij to not complain regarding `module-info` for a multi-release jar.
|
||||
* This file is completely ignored by the gradle build process
|
||||
*/
|
||||
public
|
||||
class EmptyClass {}
|
|
@ -0,0 +1,8 @@
|
|||
package dorkbox.os
|
||||
|
||||
internal object JVM {
|
||||
/**
|
||||
* Returns true if the currently running JVM is using the classpath or modules (JPMS)
|
||||
*/
|
||||
var usesJpms = true == java.lang.ModuleLayer.boot().findModule("java.desktop").isPresent
|
||||
}
|
Loading…
Reference in New Issue