@@ -101,54 +101,59 @@ internal class CachedClassPathResolver(
101101
102102 init {
103103 transaction(db) {
104- SchemaUtils .createMissingTablesAndColumns (
104+ SchemaUtils .create (
105105 ClassPathMetadataCache , ClassPathCacheEntry , BuildScriptClassPathCacheEntry
106106 )
107107 }
108108 }
109109
110- override val classpath: Set <ClassPathEntry > get() {
111- cachedClassPathEntries.let { if (! dependenciesChanged()) {
112- LOG .info(" Classpath has not changed. Fetching from cache" )
113- return it
114- } }
115-
116- LOG .info(" Cached classpath is outdated or not found. Resolving again" )
117-
118- val newClasspath = wrapped.classpath
119- // We need to make sure the cache resolve won't throw error here, make deps can be loaded successfully
120- try {
121- // in old exposed this will throw error, but I do not know if it will throw again, so I catch here
122- updateClasspathCache(newClasspath, false )
123- } catch (e: Exception ) {
124- LOG .warn(" Something error during update database, error: ${e.message} " )
125- }
110+ override val classpath: Set <ClassPathEntry >
111+ get() {
112+ cachedClassPathEntries.let {
113+ if (! dependenciesChanged()) {
114+ LOG .info(" Classpath has not changed. Fetching from cache" )
115+ return it
116+ }
117+ }
126118
127- return newClasspath
128- }
119+ LOG .info(" Cached classpath is outdated or not found. Resolving again" )
120+
121+ val newClasspath = wrapped.classpath
122+ // We need to make sure the cache resolve won't throw error here, make deps can be loaded successfully
123+ try {
124+ // in old exposed this will throw error, but I do not know if it will throw again, so I catch here
125+ updateClasspathCache(newClasspath, false )
126+ } catch (e: Exception ) {
127+ LOG .warn(" Something error during update database, error: ${e.message} " )
128+ }
129129
130- override val buildScriptClasspath: Set <Path > get() {
131- if (! dependenciesChanged()) {
132- LOG .info(" Build script classpath has not changed. Fetching from cache" )
133- return cachedBuildScriptClassPathEntries
130+ return newClasspath
134131 }
135132
136- LOG .info(" Cached build script classpath is outdated or not found. Resolving again" )
133+ override val buildScriptClasspath: Set <Path >
134+ get() {
135+ if (! dependenciesChanged()) {
136+ LOG .info(" Build script classpath has not changed. Fetching from cache" )
137+ return cachedBuildScriptClassPathEntries
138+ }
137139
138- val newBuildScriptClasspath = wrapped.buildScriptClasspath
140+ LOG .info( " Cached build script classpath is outdated or not found. Resolving again " )
139141
140- updateBuildScriptClasspathCache(newBuildScriptClasspath)
141- return newBuildScriptClasspath
142- }
142+ val newBuildScriptClasspath = wrapped.buildScriptClasspath
143+
144+ updateBuildScriptClasspathCache(newBuildScriptClasspath)
145+ return newBuildScriptClasspath
146+ }
143147
144- override val classpathWithSources: Set <ClassPathEntry > get() {
145- cachedClassPathMetadata?.let { if (! dependenciesChanged() && it.includesSources) return cachedClassPathEntries }
148+ override val classpathWithSources: Set <ClassPathEntry >
149+ get() {
150+ cachedClassPathMetadata?.let { if (! dependenciesChanged() && it.includesSources) return cachedClassPathEntries }
146151
147- val newClasspath = wrapped.classpathWithSources
148- updateClasspathCache(newClasspath, true )
152+ val newClasspath = wrapped.classpathWithSources
153+ updateClasspathCache(newClasspath, true )
149154
150- return newClasspath
151- }
155+ return newClasspath
156+ }
152157
153158 override val currentBuildFileVersion: Long get() = wrapped.currentBuildFileVersion
154159
0 commit comments