File tree Expand file tree Collapse file tree 4 files changed +14
-12
lines changed
java/com/candle/fileexplorer/viewmodel
com/candle/fileexplorer/images/32 Expand file tree Collapse file tree 4 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -69,11 +69,11 @@ jlinkZip {
6969 group = ' distribution'
7070}
7171
72- sourceSets. main {
73- resources {
74- srcDir ' src/main/resources'
75- }
76- }
72+ // sourceSets.main {
73+ // resources {
74+ // srcDir 'src/main/resources'
75+ // }
76+ // }
7777
7878allprojects {
7979 apply plugin : ' java'
@@ -85,7 +85,8 @@ allprojects {
8585
8686task createProperties (dependsOn : processResources) {
8787 doLast {
88- new File (" $buildDir /resources/version.properties" ). withWriter { w ->
88+ new File (" ${ sourceSets.main.resources.srcDirs[0]} /version.properties" ).
89+ withWriter { w ->
8990 Properties p = new Properties ()
9091 p[' version' ] = project. version. toString()
9192 p. store w, null
Original file line number Diff line number Diff line change 11package com .candle .fileexplorer .viewmodel ;
22
3- import java .io .FileInputStream ;
43import java .io .FileNotFoundException ;
54import java .io .IOException ;
5+ import java .io .InputStream ;
66import java .util .Properties ;
77
88public class AboutViewModel {
@@ -12,13 +12,12 @@ public class AboutViewModel {
1212 * Gets the version of the application.
1313 */
1414 public String getFilesVersion () {
15- Properties properties = null ;
16- FileInputStream stream = null ;
15+ Properties properties ;
16+ InputStream stream ;
1717 String version = null ;
1818 try {
19- String location = System .getProperty ("user.dir" ) + "/build" +
20- "/resources/version.properties" ;
21- stream = new FileInputStream (location );
19+
20+ stream = this .getClass ().getResourceAsStream ("/version.properties" );
2221 properties = new Properties ();
2322 properties .load (stream );
2423
Original file line number Diff line number Diff line change 1+ # Sat Jul 09 12:51:39 PDT 2022
2+ version =0.1
You can’t perform that action at this time.
0 commit comments