From ea6dadfaa53699bc696fdf986ea5f34a8ead4ea4 Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 5 Jun 2020 11:21:08 +0800 Subject: [PATCH] =?UTF-8?q?finekit=E7=89=88=E6=9C=AC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 +- src/main/java/com/fanruan/api/FineKit.java | 19 +++++-------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/build.gradle b/build.gradle index 9dc9fe6..664b778 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ static def getDate() { jar { manifest{ - attributes ("Manifest-Version" : "10.0", "Build" : getDate()) + attributes ("Implementation-Version" : "10.0", "Specification-Version" : getDate()) } baseName 'finekit' version archiveVersion.get() + "-" + getDate() diff --git a/src/main/java/com/fanruan/api/FineKit.java b/src/main/java/com/fanruan/api/FineKit.java index 21e188d..c1b02db 100644 --- a/src/main/java/com/fanruan/api/FineKit.java +++ b/src/main/java/com/fanruan/api/FineKit.java @@ -1,8 +1,5 @@ package com.fanruan.api; -import java.io.IOException; -import java.util.Properties; - /** * @author richie * @version 10.0 @@ -10,19 +7,13 @@ import java.util.Properties; */ public class FineKit { - private static String version; - private static String build; + private final static String version; + private final static String build; static { - Properties properties = new Properties(); - try { - properties.load(FineKit.class.getResourceAsStream("/version.properties")); - version = properties.getProperty("version"); - build = properties.getProperty("build"); - } catch (IOException ignore) { - version = "10.0"; - build = "20190815"; - } + Package pkg = FineKit.class.getPackage(); + version = pkg.getImplementationVersion(); + build = pkg.getSpecificationVersion(); } /**