@@ -22,75 +22,75 @@ dependencies {
2222
2323ConfigurableFileTree copyDestination = fileTree(" ./resources/web/jbrowseApp/" );
2424project. task(" copyJBrowse" ,
25- type : Copy ,
26- group : " Build" ,
27- description : " Copy jbrowse app into webapp directory" ,
28- { CopySpec copy ->
29- copy. from fileTree(" ./node_modules/@gmod/jbrowse" ). exclude(' css/main.css' )
30- copy. into copyDestination. getDir()
31- }
25+ type : Copy ,
26+ group : " Build" ,
27+ description : " Copy jbrowse app into webapp directory" ,
28+ { CopySpec copy ->
29+ copy. from fileTree(" ./node_modules/@gmod/jbrowse" ). exclude(' css/main.css' )
30+ copy. into copyDestination. getDir()
31+ }
3232). doFirst({
33- File f = project. file(' ./node_modules/@gmod/jbrowse' );
34- if (! f. exists()){
35- throw new GradleException (" Input source for copyJBrowse doesn't exist: " + f. getAbsolutePath())
36- }
33+ File f = project. file(' ./node_modules/@gmod/jbrowse' );
34+ if (! f. exists()){
35+ throw new GradleException (" Input source for copyJBrowse doesn't exist: " + f. getAbsolutePath())
36+ }
3737}). onlyIf({
38- // this is a very expensive step and the input should rarely change
39- if (copyDestination. getDir(). exists()) {
40- List<File > copiedFiles = copyDestination. exclude(" ./resources/web/jbrowseApp/css/" ). sort {it. lastModified()};
41- if (copiedFiles. isEmpty()) {
42- return true ;
43- }
44-
45- File firstModifiedCopiedFile = copiedFiles. first()
46- File lastModifiedSourceFile = fileTree(' ./node_modules/@gmod/jbrowse' ). exclude(' package.json' ). sort {it. lastModified()}. last()
47- if (firstModifiedCopiedFile. lastModified() < lastModifiedSourceFile. lastModified()) {
48- println (" Source has been modified, need to copy again" )
49- println (" Copy last copied: " + new Date (firstModifiedCopiedFile. lastModified()))
50- println (" First modified file: " + firstModifiedCopiedFile. getPath())
38+ // this is a very expensive step and the input should rarely change
39+ if (copyDestination. getDir(). exists()) {
40+ List<File > copiedFiles = copyDestination. exclude(" ./resources/web/jbrowseApp/css/" ). sort {it. lastModified()};
41+ if (copiedFiles. isEmpty()) {
42+ return true ;
43+ }
44+
45+ File firstModifiedCopiedFile = copiedFiles. first()
46+ File lastModifiedSourceFile = fileTree(' ./node_modules/@gmod/jbrowse' ). exclude(' package.json' ). sort {it. lastModified()}. last()
47+ if (firstModifiedCopiedFile. lastModified() < lastModifiedSourceFile. lastModified()) {
48+ println (" Source has been modified, need to copy again" )
49+ println (" Copy last copied: " + new Date (firstModifiedCopiedFile. lastModified()))
50+ println (" First modified file: " + firstModifiedCopiedFile. getPath())
5151
52- println (" Source last modified: " + new Date (lastModifiedSourceFile. lastModified()))
53- println (" Last modified file: " + lastModifiedSourceFile. getPath())
52+ println (" Source last modified: " + new Date (lastModifiedSourceFile. lastModified()))
53+ println (" Last modified file: " + lastModifiedSourceFile. getPath())
5454
55- return true ;
56- }
57- else {
58- println (" Up to date, no need to copy" )
59- return false ;
60- }
61- }
55+ return true ;
56+ }
57+ else {
58+ println (" Up to date, no need to copy" )
59+ return false ;
60+ }
61+ }
6262
63- return true ;
63+ return true ;
6464})
6565
6666project. task(" copyJBrowseCss" ,
67- type : Copy ,
68- group : " Build" ,
69- description : " Copy jbrowse main.css into webapp directory" ,
70- { CopySpec copy ->
71- copy. from new File (" ./webpack/main.css" )
72- copy. into new File (" ./resources/web/jbrowseApp/css/" )
73- }
67+ type : Copy ,
68+ group : " Build" ,
69+ description : " Copy jbrowse main.css into webapp directory" ,
70+ { CopySpec copy ->
71+ copy. from new File (" ./webpack/main.css" )
72+ copy. into new File (" ./resources/web/jbrowseApp/css/" )
73+ }
7474). doFirst({
75- File f = project. file(' ./resources/web/jbrowseApp/index.html' );
76- if (! f. exists())
77- {
78- throw new GradleException (" copyJBrowse was not successful. missing: " + f. getAbsolutePath())
79- }
75+ File f = project. file(' ./resources/web/jbrowseApp/index.html' );
76+ if (! f. exists())
77+ {
78+ throw new GradleException (" copyJBrowse was not successful. missing: " + f. getAbsolutePath())
79+ }
8080
81- File f2 = project. file(' ./resources/web/jbrowseApp/src/dijit/themes/dijit.css' );
82- if (! f2. exists())
83- {
84- throw new GradleException (" copyJBrowse was not successful. missing jbrowse dependencies: " + f2. getAbsolutePath())
85- }
81+ File f2 = project. file(' ./resources/web/jbrowseApp/src/dijit/themes/dijit.css' );
82+ if (! f2. exists())
83+ {
84+ throw new GradleException (" copyJBrowse was not successful. missing jbrowse dependencies: " + f2. getAbsolutePath())
85+ }
8686
87- // NOTE: due to bug/inconsistency in how the jbrowse postinstall script is run, several modules may not be copied to /src. This is a check against this.
88- // There's a jbrowse PR around this as well.
89- File f3 = project. file(' ./resources/web/jbrowseApp/src/jszlib' );
90- if (! f3. exists())
91- {
92- throw new GradleException (" copyJBrowse was not successful. missing jbrowse dependencies: " + f3. getAbsolutePath())
93- }
87+ // NOTE: due to bug/inconsistency in how the jbrowse postinstall script is run, several modules may not be copied to /src. This is a check against this.
88+ // There's a jbrowse PR around this as well.
89+ File f3 = project. file(' ./resources/web/jbrowseApp/src/jszlib' );
90+ if (! f3. exists())
91+ {
92+ throw new GradleException (" copyJBrowse was not successful. missing jbrowse dependencies: " + f3. getAbsolutePath())
93+ }
9494})
9595
9696
@@ -101,4 +101,4 @@ project.tasks.copyJBrowse.mustRunAfter("npmRunBuildProd")
101101
102102project. tasks. copyJBrowseCss. dependsOn(project. tasks. copyJBrowse)
103103project. tasks. processModuleResources. dependsOn(project. tasks. copyJBrowse)
104- project. tasks. processModuleResources. dependsOn(project. tasks. copyJBrowseCss)
104+ project. tasks. processModuleResources. dependsOn(project. tasks. copyJBrowseCss)
0 commit comments