19
19
import io .micrometer .core .instrument .binder .jvm .JvmHeapPressureMetrics ;
20
20
import io .micrometer .core .instrument .binder .jvm .JvmMemoryMetrics ;
21
21
import io .micrometer .core .instrument .simple .SimpleMeterRegistry ;
22
+ import io .micrometer .core .instrument .util .TimeUtils ;
22
23
import org .gradle .api .NamedDomainObjectContainer ;
23
24
import org .gradle .api .Project ;
24
25
import org .gradle .api .artifacts .Configuration ;
82
83
import java .nio .file .*;
83
84
import java .nio .file .attribute .BasicFileAttributes ;
84
85
import java .time .Duration ;
86
+ import java .time .Instant ;
85
87
import java .time .LocalDateTime ;
86
88
import java .time .format .DateTimeFormatter ;
87
89
import java .util .*;
@@ -653,13 +655,13 @@ public Stream<SourceFile> parse(Project subproject, Set<Path> alreadyParsed, Exe
653
655
List <NamedStyles > styles = getStyles ();
654
656
logger .lifecycle ("Using active styles {}" , styles .stream ().map (NamedStyles ::getName ).collect (toList ()));
655
657
656
- if (subproject .getPlugins ()
657
- . hasPlugin ( "org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension" ) || subproject .getExtensions ()
658
- .findByName ("kotlin" ) != null && subproject .getExtensions ()
659
- .getByName ("kotlin" )
660
- .getClass ()
661
- .getCanonicalName ()
662
- .startsWith ("org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension" )) {
658
+ if (subproject .getPlugins (). hasPlugin ( "org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension" )
659
+ || subproject .getExtensions ()
660
+ .findByName ("kotlin" ) != null && subproject .getExtensions ()
661
+ .getByName ("kotlin" )
662
+ .getClass ()
663
+ .getCanonicalName ()
664
+ .startsWith ("org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension" )) {
663
665
sourceFileStream = sourceFileStream .concat (parseMultiplatformKotlinProject (
664
666
subproject ,
665
667
exclusions ,
@@ -857,7 +859,6 @@ private SourceFileStream parseGradleProjectSourceSets(Project subproject,
857
859
858
860
Stream <SourceFile > cus = Stream .of ((Supplier <GroovyParser >) () -> GroovyParser .builder ()
859
861
.classpath (dependenciesWithBuildDirs )
860
- .styles (getStyles ())
861
862
.typeCache (javaTypeCache )
862
863
.logCompilationWarningsAndErrors (false )
863
864
.build ()).map (Supplier ::get ).flatMap (gp -> gp .parse (groovyPaths , baseDir , ctx )).map (cu -> {
@@ -934,7 +935,6 @@ private Stream<SourceFile> parseJavaFiles(
934
935
935
936
return Stream .of ((Supplier <JavaParser >) () -> JavaParser .fromJavaVersion ()
936
937
.classpath (dependencyPaths )
937
- .styles (getStyles ())
938
938
.typeCache (javaTypeCache )
939
939
.logCompilationWarningsAndErrors (extension .getLogCompilationWarningsAndErrors ())
940
940
.build ())
@@ -958,7 +958,6 @@ private Stream<SourceFile> parseKotlinFiles(List<Path> kotlinPaths,
958
958
959
959
return Stream .of ((Supplier <KotlinParser >) () -> KotlinParser .builder ()
960
960
.classpath (dependencyPaths )
961
- .styles (getStyles ())
962
961
.typeCache (javaTypeCache )
963
962
.logCompilationWarningsAndErrors (extension .getLogCompilationWarningsAndErrors ())
964
963
.build ()).map (Supplier ::get ).flatMap (kp -> kp .parse (kotlinPaths , baseDir , ctx )).map (cu -> {
@@ -998,7 +997,6 @@ private GradleParser gradleParser() {
998
997
return GradleParser .builder ()
999
998
.groovyParser (GroovyParser .builder ()
1000
999
.typeCache (new JavaTypeCache ())
1001
- .styles (getStyles ())
1002
1000
.logCompilationWarningsAndErrors (false ))
1003
1001
.buildscriptClasspath (buildscriptClasspath )
1004
1002
.settingsClasspath (settingsClasspath )
@@ -1289,7 +1287,6 @@ private SourceFileStream parseMultiplatformKotlinProject(Project subproject, Col
1289
1287
JavaTypeCache javaTypeCache = new JavaTypeCache ();
1290
1288
KotlinParser kp = KotlinParser .builder ()
1291
1289
.classpath (dependencyPaths )
1292
- .styles (getStyles ())
1293
1290
.typeCache (javaTypeCache )
1294
1291
.logCompilationWarningsAndErrors (extension .getLogCompilationWarningsAndErrors ())
1295
1292
.build ();
@@ -1433,6 +1430,9 @@ private <T extends SourceFile> UnaryOperator<T> addProvenance(List<Marker> proje
1433
1430
for (Marker marker : projectProvenance ) {
1434
1431
m = m .addIfAbsent (marker );
1435
1432
}
1433
+ for (NamedStyles style : getStyles ()) {
1434
+ m = m .addIfAbsent (style );
1435
+ }
1436
1436
return s .withMarkers (m );
1437
1437
};
1438
1438
}
0 commit comments