Skip to content

Commit 808d938

Browse files
committed
Always try to add gson dep
1 parent 87e76fa commit 808d938

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

src/ServiceStackIDEA/.idea/workspace.xml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ServiceStackIDEA/src/main/java/net/servicestack/idea/AddServiceStackRefHandler.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,15 @@ private static boolean tryAddMavenDependency(Module module) {
117117
try {
118118
IDEAPomFileHelper pomFileHelper = new IDEAPomFileHelper();
119119
String pomFilePath = IDEAPomFileHelper.findNearestModulePomFile(module);
120-
if(pomFilePath == null) {
120+
if (pomFilePath == null) {
121121
Notifications.Bus.notify(notification);
122122
return false;
123123
}
124124
File pomLibFile = new File(pomFilePath);
125-
showDto = pomFileHelper.addMavenDependency(module,pomLibFile, DepConfig.servicestackGroupId, DepConfig.clientPackageId, DepConfig.servicestackVersion) ||
126-
pomFileHelper.addMavenDependency(module,pomLibFile, DepConfig.gsonGroupId, DepConfig.gsonPackageId, DepConfig.gsonVersion);
125+
showDto = pomFileHelper.addMavenDependency(module,pomLibFile, DepConfig.servicestackGroupId, DepConfig.clientPackageId, DepConfig.servicestackVersion);
126+
if (pomFileHelper.addMavenDependency(module,pomLibFile, DepConfig.gsonGroupId, DepConfig.gsonPackageId, DepConfig.gsonVersion))
127+
showDto = true;
128+
127129
IDEAUtils.refreshFile(module,pomFilePath,showDto);
128130
} catch(Exception e) {
129131
showDto = false;
@@ -139,8 +141,11 @@ private static boolean tryAddMavenDependency(Module module) {
139141
}
140142

141143
private static boolean addGradleDependencyIfRequired(Module module) throws FileNotFoundException {
142-
if (GradleBuildFileHelper.addDependency(module, DepConfig.servicestackGroupId, DepConfig.androidPackageId, DepConfig.servicestackVersion) ||
143-
GradleBuildFileHelper.addDependency(module, DepConfig.gsonGroupId, DepConfig.gsonPackageId, DepConfig.gsonVersion)) {
144+
boolean depAdded = GradleBuildFileHelper.addDependency(module, DepConfig.servicestackGroupId, DepConfig.androidPackageId, DepConfig.servicestackVersion);
145+
if (GradleBuildFileHelper.addDependency(module, DepConfig.gsonGroupId, DepConfig.gsonPackageId, DepConfig.gsonVersion))
146+
depAdded = true;
147+
148+
if (depAdded) {
144149
IDEAUtils.refreshBuildFile(module);
145150
return true;
146151
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy