ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [47/50] [abbrv] ignite git commit: IGNITE-5710 Change H2 version in depend to Ignite version.
Date Fri, 07 Jul 2017 09:37:48 GMT
IGNITE-5710 Change H2 version in depend to Ignite version.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/516e73a4
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/516e73a4
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/516e73a4

Branch: refs/heads/master
Commit: 516e73a4baf21c86f46bee03a00e336db3ffe567
Parents: 64d6c98
Author: vsisko <vsisko@gridgain.com>
Authored: Fri Jul 7 15:19:08 2017 +0700
Committer: vsisko <vsisko@gridgain.com>
Committed: Fri Jul 7 15:19:08 2017 +0700

----------------------------------------------------------------------
 .../frontend/app/data/pom-dependencies.json     |  5 ++++-
 .../configuration/generator/Maven.service.js    | 21 +++++++++++++-------
 2 files changed, 18 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/516e73a4/modules/web-console/frontend/app/data/pom-dependencies.json
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/data/pom-dependencies.json b/modules/web-console/frontend/app/data/pom-dependencies.json
index 3e0543b..945e3f5 100644
--- a/modules/web-console/frontend/app/data/pom-dependencies.json
+++ b/modules/web-console/frontend/app/data/pom-dependencies.json
@@ -14,7 +14,10 @@
     "Generic": {"groupId": "com.mchange", "artifactId": "c3p0", "version": "0.9.5.2"},
     "MySQL": {"groupId": "mysql", "artifactId": "mysql-connector-java", "version": "5.1.40"},
     "PostgreSQL": {"groupId": "org.postgresql", "artifactId": "postgresql", "version": "9.4.1212.jre7"},
-    "H2": {"groupId": "com.h2database", "artifactId": "h2", "version": "1.4.191"},
+    "H2": {"groupId": "com.h2database", "artifactId": "h2", "version": [
+        {"range": ["1.0.0", "2.0.0"], "version": "1.4.191"},
+        {"range": "2.0.0", "version": "1.4.195"}
+    ]},
     "Oracle": {"groupId": "com.oracle.jdbc", "artifactId": "ojdbc7", "version": "12.1.0.2",
"jar": "ojdbc7.jar"},
     "DB2": {"groupId": "ibm", "artifactId": "jdbc", "version": "4.21.29", "jar": "db2jcc4.jar"},
     "SQLServer": {"groupId": "microsoft", "artifactId": "jdbc", "version": "4.2", "jar":
"sqljdbc41.jar"}

http://git-wip-us.apache.org/repos/asf/ignite/blob/516e73a4/modules/web-console/frontend/app/modules/configuration/generator/Maven.service.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/configuration/generator/Maven.service.js
b/modules/web-console/frontend/app/modules/configuration/generator/Maven.service.js
index da098fc..700da4a 100644
--- a/modules/web-console/frontend/app/modules/configuration/generator/Maven.service.js
+++ b/modules/web-console/frontend/app/modules/configuration/generator/Maven.service.js
@@ -16,6 +16,9 @@
  */
 
 import StringBuilder from './StringBuilder';
+import VersionService from 'app/modules/configuration/Version.service';
+
+const versionService = new VersionService();
 
 // Java built-in class names.
 import POM_DEPENDENCIES from 'app/data/pom-dependencies.json';
@@ -39,13 +42,17 @@ export default class IgniteMavenGenerator {
         deps.add({groupId, artifactId, version, jar});
     }
 
-    pickDependency(deps, key, dfltVer) {
+    pickDependency(deps, key, dfltVer, igniteVer) {
+        const extractVersion = (version) => {
+            return _.isArray(version) ? _.find(version, (v) => versionService.since(igniteVer,
v.range)).version : version;
+        };
+
         if (!_.has(POM_DEPENDENCIES, key))
             return;
 
         const {groupId, artifactId, version, jar} = POM_DEPENDENCIES[key];
 
-        this.addDependency(deps, groupId || 'org.apache.ignite', artifactId, version || dfltVer,
jar);
+        this.addDependency(deps, groupId || 'org.apache.ignite', artifactId, extractVersion(version)
|| dfltVer, jar);
     }
 
     addResource(sb, dir, exclude) {
@@ -139,9 +146,9 @@ export default class IgniteMavenGenerator {
      * @param deps Already added dependencies.
      * @param storeFactory Store factory to add dependency.
      */
-    storeFactoryDependency(deps, storeFactory) {
+    storeFactoryDependency(deps, storeFactory, igniteVer) {
         if (storeFactory.dialect && (!storeFactory.connectVia || storeFactory.connectVia
=== 'DataSource'))
-            this.pickDependency(deps, storeFactory.dialect);
+            this.pickDependency(deps, storeFactory.dialect, null, igniteVer);
     }
 
     collectDependencies(cluster, targetVer) {
@@ -167,7 +174,7 @@ export default class IgniteMavenGenerator {
 
         _.forEach(caches, (cache) => {
             if (cache.cacheStoreFactory && cache.cacheStoreFactory.kind)
-                this.storeFactoryDependency(storeDeps, cache.cacheStoreFactory[cache.cacheStoreFactory.kind]);
+                this.storeFactoryDependency(storeDeps, cache.cacheStoreFactory[cache.cacheStoreFactory.kind],
igniteVer);
 
             if (_.get(cache, 'nodeFilter.kind') === 'Exclude')
                 this.addDependency(deps, 'org.apache.ignite', 'ignite-extdata-p2p', igniteVer);
@@ -177,14 +184,14 @@ export default class IgniteMavenGenerator {
             const store = cluster.discovery.Jdbc;
 
             if (store.dataSourceBean && store.dialect)
-                this.storeFactoryDependency(storeDeps, cluster.discovery.Jdbc);
+                this.storeFactoryDependency(storeDeps, cluster.discovery.Jdbc, igniteVer);
         }
 
         _.forEach(cluster.checkpointSpi, (spi) => {
             if (spi.kind === 'S3')
                 this.pickDependency(deps, spi.kind, igniteVer);
             else if (spi.kind === 'JDBC')
-                this.storeFactoryDependency(storeDeps, spi.JDBC);
+                this.storeFactoryDependency(storeDeps, spi.JDBC, igniteVer);
         });
 
         if (_.get(cluster, 'hadoopConfiguration.mapReducePlanner.kind') === 'Weighted' ||


Mime
View raw message