kopia lustrzana https://github.com/JOSM/MapWithAI
rodzic
207161b6c6
commit
96503e69d0
|
@ -1,6 +1,6 @@
|
|||
# JOSM MapWithAI Plugin (formerly RapiD Plugin)
|
||||
|
||||
[![pipeline status](https://gitlab.com/gokaart/JOSM_MapWithAI/badges/master/pipeline.svg)](https://gitlab.com/gokaart/JOSM_MapWithAI/commits/master)
|
||||
[![pipeline status](https://github.com/JOSM/MapWithAI/actions/workflows/ant.yml/badge.svg)](https://github.com/JOSM/MapWithAI/actions/workflows/ant.yml)
|
||||
[![code coverage](https://gitlab.com/gokaart/JOSM_MapWithAI/badges/master/coverage.svg)](https://codecov.io/github/gokaart/JOSM_MapWithAI?branch=master)
|
||||
[![license](https://img.shields.io/badge/license-GPLv2-blue.svg?style=flat-square)](./LICENSE)
|
||||
|
||||
|
@ -22,7 +22,7 @@ See the [wiki page](https://josm.openstreetmap.de/wiki/Help/Plugin/MapWithAI).
|
|||
|
||||
## Contributing
|
||||
|
||||
- The **source code** is hosted on [GitLab](https://gitlab.com/gokaart/JOSM_MapWithAI).
|
||||
- The **source code** is hosted on [GitHub](https://github.com/JOSM/MapWithAI).
|
||||
- **Issues** are managed in [JOSM Trac](https://josm.openstreetmap.de/query?status=assigned&status=needinfo&status=new&status=reopened&component=Plugin+mapwithai&group=component&max=200&col=id&col=summary&col=component&col=status&col=type&col=priority&order=priority&report=17)
|
||||
- Report a [New Ticket](https://josm.openstreetmap.de/newticket?component=Plugin+mapwithai)
|
||||
- **Translations** are not currently done.
|
||||
|
|
20
build.gradle
20
build.gradle
|
@ -225,16 +225,16 @@ spotless {
|
|||
josm {
|
||||
debugPort = 7055
|
||||
manifest {
|
||||
oldVersionDownloadLink 17903, "v1.8.7", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.8.7/mapwithai.jar")
|
||||
oldVersionDownloadLink 17084, "v1.7.1.6", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.7.1.6/mapwithai.jar")
|
||||
oldVersionDownloadLink 16645, "v1.6.8", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.6.8/mapwithai.jar")
|
||||
oldVersionDownloadLink 16284, "v1.5.10", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.5.10/mapwithai.jar")
|
||||
oldVersionDownloadLink 16220, "v1.4.7", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.4.7/mapwithai.jar")
|
||||
oldVersionDownloadLink 15820, "v1.3.11", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.3.11/mapwithai.jar")
|
||||
oldVersionDownloadLink 15737, "v1.2.7", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.2.7/mapwithai.jar")
|
||||
oldVersionDownloadLink 15609, "v1.1.12", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.1.12/mapwithai.jar")
|
||||
oldVersionDownloadLink 15542, "v1.0.9", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.0.9/mapwithai.jar")
|
||||
oldVersionDownloadLink 15233, "v0.2.14", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v0.2.14/mapwithai.jar")
|
||||
oldVersionDownloadLink 17903, "v1.8.7", new URL("https://github.com/JOSM/MapWithAI/releases/download/v1.8.7/mapwithai.jar")
|
||||
oldVersionDownloadLink 17084, "v1.7.1.6", new URL("https://github.com/JOSM/MapWithAI/releases/download/v1.7.1.6/mapwithai.jar")
|
||||
oldVersionDownloadLink 16645, "v1.6.8", new URL("https://github.com/JOSM/MapWithAI/releases/download/v1.6.8/mapwithai.jar")
|
||||
oldVersionDownloadLink 16284, "v1.5.10", new URL("https://github.com/JOSM/MapWithAI/releases/download/v1.5.10/mapwithai.jar")
|
||||
oldVersionDownloadLink 16220, "v1.4.7", new URL("https://github.com/JOSM/MapWithAI/releases/download/v1.4.7/mapwithai.jar")
|
||||
oldVersionDownloadLink 15820, "v1.3.11", new URL("https://github.com/JOSM/MapWithAI/releases/download/v1.3.11/mapwithai.jar")
|
||||
oldVersionDownloadLink 15737, "v1.2.7", new URL("https://github.com/JOSM/MapWithAI/releases/download/v1.2.7/mapwithai.jar")
|
||||
oldVersionDownloadLink 15609, "v1.1.12", new URL("https://github.com/JOSM/MapWithAI/releases/download/v1.1.12/mapwithai.jar")
|
||||
oldVersionDownloadLink 15542, "v1.0.9", new URL("https://github.com/JOSM/MapWithAI/releases/download/v1.0.9/mapwithai.jar")
|
||||
oldVersionDownloadLink 15233, "v0.2.14", new URL("https://github.com/JOSM/MapWithAI/releases/download/v0.2.14/mapwithai.jar")
|
||||
}
|
||||
i18n {
|
||||
pathTransformer = getPathTransformer(project.projectDir, "gitlab.com/${gitlabGroup}/${gitlabRepositoryName}/blob")
|
||||
|
|
|
@ -8,7 +8,7 @@ plugin.canloadatruntime = true
|
|||
plugin.author = Taylor Smock
|
||||
plugin.class = org.openstreetmap.josm.plugins.mapwithai.MapWithAIPlugin
|
||||
plugin.icon = images/dialogs/mapwithai.svg
|
||||
plugin.link = https://gitlab.com/gokaart/JOSM_MapWithAI
|
||||
plugin.link = https://github.com/JOSM/MapWithAI
|
||||
plugin.description = Allows the use of MapWithAI data in JOSM (same data as used in RapiD)
|
||||
|
||||
plugin.requires = utilsplugin2;apache-http
|
||||
|
|
|
@ -185,7 +185,7 @@ public class MapWithAIPreferences extends DefaultTabPreferenceSetting {
|
|||
kaartLogo.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
OpenBrowser.displayUrl("https://gitlab.com/gokaart/JOSM_MapWithAI");
|
||||
OpenBrowser.displayUrl("https://github.com/JOSM/MapWithAI");
|
||||
}
|
||||
});
|
||||
kaartLogo.setCursor(new Cursor(Cursor.HAND_CURSOR));
|
||||
|
|
|
@ -402,8 +402,8 @@ public class MapWithAIProvidersPanel extends JPanel {
|
|||
add(defaultToolbar, GBC.eol().anchor(GBC.SOUTH).insets(0, 0, 5, 0));
|
||||
|
||||
HtmlPanel help = new HtmlPanel(
|
||||
tr("New default entries can be added in the <a href=\"{0}\">GitLab Repository</a>.",
|
||||
"https://gitlab.com/gokaart/JOSM_MapWithAI/-/blob/pages/public/json/sources.json"));
|
||||
tr("New default entries can be added in the <a href=\"{0}\">GitHub Repository</a>.",
|
||||
"https://github.com/JOSM/MapWithAI/blob/pages/json/sources.json"));
|
||||
help.enableClickableHyperlinks();
|
||||
add(help, GBC.eol().insets(10, 0, 0, 0).fill(GBC.HORIZONTAL));
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.openstreetmap.josm.tools.Territories;
|
|||
* definition file.
|
||||
* <p>
|
||||
* The format is specified in the <a href=
|
||||
* "https://gitlab.com/gokaart/JOSM_MapWithAI/-/blob/pages/public/json/sources.json">MapWithAI
|
||||
* "https://github.com/JOSM/MapWithAI/blob/pages/json/sources.json">MapWithAI
|
||||
* source</a>.
|
||||
*/
|
||||
public class MapWithAISourceReader extends CommonSourceReader<List<MapWithAIInfo>> implements Closeable {
|
||||
|
|
|
@ -2,10 +2,12 @@
|
|||
package org.openstreetmap.josm.plugins.mapwithai.spi.preferences;
|
||||
|
||||
public class MapWithAIUrls implements IMapWithAIUrls {
|
||||
/** The base url */
|
||||
private static final String BASE_URL = "https://josm.github.io/MapWithAI/";
|
||||
/** The default url for additional conflation servers */
|
||||
private static final String DEFAULT_CONFLATION_JSON = "https://gokaart.gitlab.io/JOSM_MapWithAI/json/conflation_servers.json";
|
||||
private static final String DEFAULT_CONFLATION_JSON = BASE_URL + "json/conflation_servers.json";
|
||||
/** The default URL for the MapWithAI sources */
|
||||
private static final String DEFAULT_MAPWITHAI_SOURCES_JSON = "https://gokaart.gitlab.io/JOSM_MapWithAI/json/sources.json";
|
||||
private static final String DEFAULT_MAPWITHAI_SOURCES_JSON = BASE_URL + "json/sources.json";
|
||||
/** The default url for the MapWithAI paint style */
|
||||
private static final String DEFAULT_PAINT_STYLE_RESOURCE_URL = "https://josm.openstreetmap.de/josmfile?page=Styles/MapWithAI&zip=1";
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.openstreetmap.josm.tools.Logging;
|
|||
*
|
||||
*/
|
||||
public final class BlacklistUtils {
|
||||
static final String DEFAULT_BLACKLIST_URL = "https://gokaart.gitlab.io/JOSM_MapWithAI/json/blacklisted_versions.json";
|
||||
static final String DEFAULT_BLACKLIST_URL = "https://josm.github.io/MapWithAI/json/blacklisted_versions.json";
|
||||
private static String blacklistUrl = DEFAULT_BLACKLIST_URL;
|
||||
|
||||
private BlacklistUtils() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id" : "fb2197f1-81fd-445d-bb90-b6219d187af6",
|
||||
"name" : "josm_mapwithai_json_conflation_serversjson",
|
||||
"request" : {
|
||||
"url" : "/JOSM_MapWithAI/json/conflation_servers.json",
|
||||
"url" : "/MapWithAI/json/conflation_servers.json",
|
||||
"method" : "GET"
|
||||
},
|
||||
"response" : {
|
||||
|
@ -21,4 +21,4 @@
|
|||
"uuid" : "fb2197f1-81fd-445d-bb90-b6219d187af6",
|
||||
"persistent" : true,
|
||||
"insertionIndex" : 43
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id" : "23497750-675c-440a-986a-34dd14b047f8",
|
||||
"name" : "josm_mapwithai_json_sourcesjson",
|
||||
"request" : {
|
||||
"urlPattern" : "(\/gokaart)?\/JOSM_MapWithAI\/(-\/raw\/pages\/public\/)?json\/sources.json",
|
||||
"urlPattern" : "\/MapWithAI\/?json\/sources.json",
|
||||
"method" : "GET"
|
||||
},
|
||||
"response" : {
|
||||
|
|
|
@ -50,12 +50,12 @@ public @interface MapWithAIConfig {
|
|||
|
||||
@Override
|
||||
public String getConflationServerJson() {
|
||||
return this.wireMockServer.baseUrl() + "/JOSM_MapWithAI/json/conflation_servers.json";
|
||||
return this.wireMockServer.baseUrl() + "/MapWithAI/json/conflation_servers.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMapWithAISourcesJson() {
|
||||
return this.wireMockServer.baseUrl() + "/JOSM_MapWithAI/json/sources.json";
|
||||
return this.wireMockServer.baseUrl() + "/MapWithAI/json/sources.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -184,8 +184,8 @@ public @interface Wiremock {
|
|||
|
||||
if (wireMockServer.getStubMappings().stream().filter(mapping -> mapping.getRequest().getUrl() != null)
|
||||
.noneMatch(mapping -> mapping.getRequest().getUrl()
|
||||
.equals("/JOSM_MapWithAI/json/conflation_servers.json"))) {
|
||||
wireMockServer.stubFor(WireMock.get("/JOSM_MapWithAI/json/conflation_servers.json")
|
||||
.equals("/MapWithAI/json/conflation_servers.json"))) {
|
||||
wireMockServer.stubFor(WireMock.get("/MapWithAI/json/conflation_servers.json")
|
||||
.willReturn(WireMock.aResponse().withBody("{}")).atPriority(-5));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class BlacklistUtilsTest {
|
|||
TestUtils.assumeWorkingJMockit();
|
||||
wireMock = new WireMockServer(options().dynamicPort());
|
||||
wireMock.start();
|
||||
BlacklistUtils.setBlacklistUrl(wireMock.baseUrl() + "/JOSM_MapWithAI/json/blacklisted_versions.json");
|
||||
BlacklistUtils.setBlacklistUrl(wireMock.baseUrl() + "/MapWithAI/json/blacklisted_versions.json");
|
||||
new MapWithAIPluginMock();
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ class BlacklistUtilsTest {
|
|||
|
||||
@Test
|
||||
void testArrayBad() {
|
||||
wireMock.addStubMapping(get(urlMatching("/JOSM_MapWithAI/json/blacklisted_versions.json"))
|
||||
wireMock.addStubMapping(get(urlMatching("/MapWithAI/json/blacklisted_versions.json"))
|
||||
.willReturn(aResponse().withStatus(200).withBody("[\"" + MapWithAIPlugin.getVersionInfo() + "\"]"))
|
||||
.build());
|
||||
assertTrue(BlacklistUtils.isBlacklisted());
|
||||
|
@ -66,37 +66,35 @@ class BlacklistUtilsTest {
|
|||
|
||||
@Test
|
||||
void testArrayGood() {
|
||||
wireMock.addStubMapping(get(urlMatching("/JOSM_MapWithAI/json/blacklisted_versions.json"))
|
||||
wireMock.addStubMapping(get(urlMatching("/MapWithAI/json/blacklisted_versions.json"))
|
||||
.willReturn(aResponse().withStatus(200).withBody("[null, 0, false]")).build());
|
||||
assertFalse(BlacklistUtils.isBlacklisted());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testObjectBad() {
|
||||
wireMock.addStubMapping(get(urlMatching("/JOSM_MapWithAI/json/blacklisted_versions.json"))
|
||||
.willReturn(aResponse().withStatus(200)
|
||||
.withBody("{ \"" + MapWithAIPlugin.getVersionInfo() + "\": \"reason here\"}"))
|
||||
.build());
|
||||
wireMock.addStubMapping(get(urlMatching("/MapWithAI/json/blacklisted_versions.json")).willReturn(aResponse()
|
||||
.withStatus(200).withBody("{ \"" + MapWithAIPlugin.getVersionInfo() + "\": \"reason here\"}")).build());
|
||||
assertTrue(BlacklistUtils.isBlacklisted());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testObjectGood() {
|
||||
wireMock.addStubMapping(get(urlMatching("/JOSM_MapWithAI/json/blacklisted_versions.json"))
|
||||
wireMock.addStubMapping(get(urlMatching("/MapWithAI/json/blacklisted_versions.json"))
|
||||
.willReturn(aResponse().withStatus(200).withBody("{ \"version\": \"reason here\"}")).build());
|
||||
assertFalse(BlacklistUtils.isBlacklisted());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testNullJson() {
|
||||
wireMock.addStubMapping(get(urlMatching("/JOSM_MapWithAI/json/blacklisted_versions.json"))
|
||||
wireMock.addStubMapping(get(urlMatching("/MapWithAI/json/blacklisted_versions.json"))
|
||||
.willReturn(aResponse().withStatus(200).withBody("null")).build());
|
||||
assertTrue(BlacklistUtils.isBlacklisted());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testBrokenJson() {
|
||||
wireMock.addStubMapping(get(urlMatching("/JOSM_MapWithAI/json/blacklisted_versions.json")).willReturn(
|
||||
wireMock.addStubMapping(get(urlMatching("/MapWithAI/json/blacklisted_versions.json")).willReturn(
|
||||
aResponse().withStatus(200).withBody("{ \"" + MapWithAIPlugin.getVersionInfo() + "\": \"reason here\""))
|
||||
.build());
|
||||
assertTrue(BlacklistUtils.isBlacklisted());
|
||||
|
@ -105,14 +103,14 @@ class BlacklistUtilsTest {
|
|||
@Test
|
||||
void testNoResponse() {
|
||||
wireMock.addStubMapping(
|
||||
get(urlMatching("/JOSM_MapWithAI/json/blacklisted_versions.json")).willReturn(noContent()).build());
|
||||
get(urlMatching("/MapWithAI/json/blacklisted_versions.json")).willReturn(noContent()).build());
|
||||
assertTrue(BlacklistUtils.isBlacklisted());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testNotFound() {
|
||||
wireMock.addStubMapping(
|
||||
get(urlMatching("/JOSM_MapWithAI/json/blacklisted_versions.json")).willReturn(notFound()).build());
|
||||
get(urlMatching("/MapWithAI/json/blacklisted_versions.json")).willReturn(notFound()).build());
|
||||
assertTrue(BlacklistUtils.isBlacklisted());
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue