■ ■ ■ ■ ■ ■
src/main/java/io/onedev/plugin/maven/PackageArtifactsMojo.java
| skipped 89 lines |
90 | 90 | | Copy copy = new Copy(); |
91 | 91 | | copy.setProject(antProject); |
92 | 92 | | copy.setTofile(new File(sandboxDir, "bin/" + commandName + ".sh")); |
93 | | - | copy.setFile(new File(project.getBasedir(), "jsw/sh.script.in")); |
| 93 | + | copy.setFile(new File(project.getBasedir(), "jsw/App.sh.in")); |
94 | 94 | | FilterSet filterSet = copy.createFilterSet(); |
95 | 95 | | filterSet.addFilter("app.name", "onedev_" + commandName); |
96 | 96 | | filterSet.addFilter("app.long.name", "OneDev " + commandDisplayName); |
| skipped 54 lines |
151 | 151 | | PluginUtils.populateArtifacts(project, sandboxDir, repoSystem, repoSession, remoteRepos); |
152 | 152 | | |
153 | 153 | | if (productPropsFile.exists()) { |
| 154 | + | File jswDir = new File(project.getBasedir(), "jsw"); |
| 155 | + | File deltaPackFile = null; |
| 156 | + | for (File file: jswDir.listFiles()) { |
| 157 | + | if (file.getName().startsWith("wrapper-delta-pack-") && file.getName().endsWith(".zip")) { |
| 158 | + | deltaPackFile = file; |
| 159 | + | break; |
| 160 | + | } |
| 161 | + | } |
| 162 | + | if (deltaPackFile == null) |
| 163 | + | throw new RuntimeException("Unable to find file " + jswDir.getAbsolutePath() + "/wrapper-delta-pack-<version>-st.zip"); |
| 164 | + | |
154 | 165 | | Expand expand = new Expand(); |
155 | 166 | | expand.setProject(antProject); |
156 | | - | expand.setSrc(new File(project.getBasedir(), "jsw/wrapper-delta-pack.zip")); |
157 | | - | File jswDir = new File(project.getBasedir(), "jsw"); |
158 | | - | File wrapperDir = new File(buildDir, "wrapper"); |
159 | | - | expand.setDest(wrapperDir); |
| 167 | + | |
| 168 | + | expand.setSrc(deltaPackFile); |
| 169 | + | File extractDir = new File(buildDir, "extract"); |
| 170 | + | expand.setDest(extractDir); |
160 | 171 | | expand.execute(); |
| 172 | + | |
| 173 | + | File wrapperDir = null; |
| 174 | + | for (File file: extractDir.listFiles()) { |
| 175 | + | if (file.getName().startsWith("wrapper-delta-pack-")) { |
| 176 | + | wrapperDir = file; |
| 177 | + | break; |
| 178 | + | } |
| 179 | + | } |
| 180 | + | if (wrapperDir == null) |
| 181 | + | throw new RuntimeException("Unable to find wrapper delta pack directory under " + extractDir.getAbsolutePath()); |
161 | 182 | | |
162 | 183 | | File bootDir = new File(sandboxDir, "boot"); |
163 | 184 | | Copy copy = new Copy(); |
| skipped 37 lines |
201 | 222 | | |
202 | 223 | | copy = new Copy(); |
203 | 224 | | copy.setTofile(new File(binDir, "server.sh")); |
204 | | - | copy.setFile(new File(jswDir, "sh.script.in")); |
| 225 | + | copy.setFile(new File(jswDir, "App.sh.in")); |
205 | 226 | | filterSet = copy.createFilterSet(); |
206 | 227 | | filterSet.addConfiguredFilterSet(appFilterSet); |
207 | 228 | | filterSet.addFilter("set_fixed_command", ""); |
| skipped 95 lines |