@@ -101,54 +101,59 @@ internal class CachedClassPathResolver(
101
101
102
102
init {
103
103
transaction(db) {
104
- SchemaUtils .createMissingTablesAndColumns (
104
+ SchemaUtils .create (
105
105
ClassPathMetadataCache , ClassPathCacheEntry , BuildScriptClassPathCacheEntry
106
106
)
107
107
}
108
108
}
109
109
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
+ }
126
118
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
+ }
129
129
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
134
131
}
135
132
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
+ }
137
139
138
- val newBuildScriptClasspath = wrapped.buildScriptClasspath
140
+ LOG .info( " Cached build script classpath is outdated or not found. Resolving again " )
139
141
140
- updateBuildScriptClasspathCache(newBuildScriptClasspath)
141
- return newBuildScriptClasspath
142
- }
142
+ val newBuildScriptClasspath = wrapped.buildScriptClasspath
143
+
144
+ updateBuildScriptClasspathCache(newBuildScriptClasspath)
145
+ return newBuildScriptClasspath
146
+ }
143
147
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 }
146
151
147
- val newClasspath = wrapped.classpathWithSources
148
- updateClasspathCache(newClasspath, true )
152
+ val newClasspath = wrapped.classpathWithSources
153
+ updateClasspathCache(newClasspath, true )
149
154
150
- return newClasspath
151
- }
155
+ return newClasspath
156
+ }
152
157
153
158
override val currentBuildFileVersion: Long get() = wrapped.currentBuildFileVersion
154
159
0 commit comments