Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ask "Is this inside a building" #5248

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .github/workflows/generate-quest-list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
name: Generate quest list
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
- uses: actions/checkout@v3
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
java-version: '11'
distribution: 'adopt'

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
19 changes: 9 additions & 10 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import java.util.Properties
plugins {
id("com.android.application")
kotlin("android")
kotlin("plugin.serialization") version "1.9.10"
kotlin("plugin.serialization") version "1.8.21"
}

android {
Expand Down Expand Up @@ -34,8 +34,8 @@ android {
applicationId = "de.westnordost.streetcomplete"
minSdk = 21
targetSdk = 33
versionCode = 5402
versionName = "54.1"
versionCode = 5400
versionName = "54.0-beta1"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

Expand Down Expand Up @@ -63,7 +63,6 @@ android {

buildFeatures {
viewBinding = true
buildConfig = true
}

bundle {
Expand Down Expand Up @@ -102,7 +101,6 @@ configurations {
all {
// it's already included in Android
exclude(group = "net.sf.kxml", module = "kxml2")
exclude(group = "xmlpull", module = "xmlpull")
}
}

Expand All @@ -112,6 +110,7 @@ dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3")

// tests
testImplementation("junit:junit:4.13.2")
testImplementation("org.mockito:mockito-core:$mockitoVersion")
testImplementation("org.mockito:mockito-inline:$mockitoVersion")
testImplementation("org.assertj:assertj-core:3.23.1")
Expand Down Expand Up @@ -158,8 +157,8 @@ dependencies {
// finding a name for a feature without a name tag
implementation("de.westnordost:osmfeatures-android:5.2")
// talking with the OSM API
implementation("de.westnordost:osmapi-map:2.3")
implementation("de.westnordost:osmapi-changesets:2.3")
implementation("de.westnordost:osmapi-map:2.1")
implementation("de.westnordost:osmapi-changesets:2.1")
implementation("de.westnordost:osmapi-notes:2.0")
implementation("de.westnordost:osmapi-traces:2.0")
implementation("de.westnordost:osmapi-user:2.0")
Expand Down Expand Up @@ -194,14 +193,14 @@ dependencies {
/** Localizations that should be pulled from POEditor */
val bcp47ExportLanguages = setOf(
"am", "ar", "ast", "be", "bg", "bs", "ca", "cs", "da", "de", "el",
"en", "en-AU", "en-GB", "eo", "es", "eu", "fa", "fi", "fr", "gl", "he", "hr", "hu", "hy",
"en", "en-AU", "en-GB", "eo", "es", "eu", "fa", "fi", "fr", "gl", "hr", "hu", "hy",
"id", "it", "ja", "ko", "lt", "lv", "nb", "no", "nl", "nn", "pl", "pt", "pt-BR",
"ro", "ru", "sk", "sl", "sr-cyrl", "sr-latn", "sv", "sw", "th", "tr", "uk",
"ro", "ru", "sk", "sr-cyrl", "sr-latn", "sv", "sw", "th", "tr", "uk",
"zh", "zh-CN", "zh-HK", "zh-TW"
)

// see https://github.com/osmlab/name-suggestion-index/tags for latest version
val nsiVersion = "v6.0.20230925"
val nsiVersion = "v6.0.20230816"
// see https://github.com/openstreetmap/id-tagging-schema/releases for latest version
val presetsVersion = "v6.4.1"

Expand Down
8 changes: 8 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
-dontobfuscate

-dontwarn org.xmlpull.**
-dontnote org.xmlpull.**

# https://issuetracker.google.com/issues/37070898
-dontnote android.net.http.*
-dontnote org.apache.commons.codec.**
-dontnote org.apache.http.**

# tangram start ------------------------------------------------------------------------------------

# let's just keep everything
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ package de.westnordost.streetcomplete.data

import android.database.sqlite.SQLiteOpenHelper
import androidx.test.platform.app.InstrumentationRegistry
import kotlin.test.AfterTest
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertNotNull
import org.junit.After
import org.junit.Assert
import org.junit.Before
import org.junit.Test

open class ApplicationDbTestCase {
protected lateinit var dbHelper: SQLiteOpenHelper
protected lateinit var database: Database

@BeforeTest fun setUpHelper() {
@Before fun setUpHelper() {
dbHelper = StreetCompleteSQLiteOpenHelper(
InstrumentationRegistry.getInstrumentation().targetContext,
DATABASE_NAME
Expand All @@ -20,10 +20,10 @@ open class ApplicationDbTestCase {
}

@Test fun databaseAvailable() {
assertNotNull(dbHelper.readableDatabase)
Assert.assertNotNull(dbHelper.readableDatabase)
}

@AfterTest fun tearDownHelper() {
@After fun tearDownHelper() {
dbHelper.close()
InstrumentationRegistry.getInstrumentation().targetContext
.deleteDatabase(DATABASE_NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ package de.westnordost.streetcomplete.data.download.tiles
import de.westnordost.streetcomplete.data.ApplicationDbTestCase
import de.westnordost.streetcomplete.util.ktx.containsExactlyInAnyOrder
import de.westnordost.streetcomplete.util.ktx.nowAsEpochMilliseconds
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertTrue
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test

class DownloadedTilesDaoTest : ApplicationDbTestCase() {
private lateinit var dao: DownloadedTilesDao

@BeforeTest fun createDao() {
@Before fun createDao() {
dao = DownloadedTilesDao(database)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package de.westnordost.streetcomplete.data.meta

import androidx.test.platform.app.InstrumentationRegistry
import de.westnordost.streetcomplete.osm.opening_hours.model.Weekdays.Companion.getWeekdayIndex
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotNull
import kotlin.test.assertTrue
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertTrue
import org.junit.Test

class CountryInfosTest {
private val validWeekdays = listOf("Mo", "Tu", "We", "Th", "Fr", "Sa", "Su")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package de.westnordost.streetcomplete.data.osm.created_elements
import de.westnordost.streetcomplete.data.ApplicationDbTestCase
import de.westnordost.streetcomplete.data.osm.mapdata.ElementKey
import de.westnordost.streetcomplete.data.osm.mapdata.ElementType
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test

class CreatedElementsDaoTest : ApplicationDbTestCase() {
private lateinit var dao: CreatedElementsDao

@BeforeTest fun createDao() {
@Before fun createDao() {
dao = CreatedElementsDao(database)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import de.westnordost.streetcomplete.data.ApplicationDbTestCase
import de.westnordost.streetcomplete.data.osm.mapdata.ElementKey
import de.westnordost.streetcomplete.data.osm.mapdata.ElementType
import de.westnordost.streetcomplete.util.ktx.containsExactlyInAnyOrder
import kotlin.test.*
import kotlin.test.BeforeTest
import kotlin.test.Test
import org.junit.Assert.*
import org.junit.Before
import org.junit.Test

class EditElementsDaoTest : ApplicationDbTestCase() {
private lateinit var dao: EditElementsDao

@BeforeTest fun createDao() {
@Before fun createDao() {
dao = EditElementsDao(database)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ import de.westnordost.streetcomplete.data.quest.QuestTypeRegistry
import de.westnordost.streetcomplete.data.user.achievements.EditTypeAchievement
import de.westnordost.streetcomplete.overlays.Overlay
import de.westnordost.streetcomplete.overlays.Style
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertNotNull
import kotlin.test.assertNull
import kotlin.test.assertTrue
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test

class ElementEditsDaoTest : ApplicationDbTestCase() {
private lateinit var dao: ElementEditsDao

@BeforeTest fun createDao() {
@Before fun createDao() {
val list = listOf(1 to TEST_QUEST_TYPE, 2 to TEST_QUEST_TYPE2)
val list2 = listOf(1 to TestOverlay)
dao = ElementEditsDao(database, QuestTypeRegistry(list), OverlayRegistry(list2))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import de.westnordost.streetcomplete.data.ApplicationDbTestCase
import de.westnordost.streetcomplete.data.osm.mapdata.ElementIdUpdate
import de.westnordost.streetcomplete.data.osm.mapdata.ElementKey
import de.westnordost.streetcomplete.data.osm.mapdata.ElementType
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertEquals
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
import kotlin.test.assertFailsWith
import kotlin.test.assertTrue

class ElementIdProviderDaoTest : ApplicationDbTestCase() {
private lateinit var dao: ElementIdProviderDao

@BeforeTest fun createDao() {
@Before fun createDao() {
dao = ElementIdProviderDao(database)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package de.westnordost.streetcomplete.data.osm.edits.upload.changesets

import de.westnordost.streetcomplete.data.ApplicationDbTestCase
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertNull
import kotlin.test.assertTrue
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test

class OpenChangesetsDaoTest : ApplicationDbTestCase() {
private lateinit var dao: OpenChangesetsDao
Expand All @@ -15,7 +15,7 @@ class OpenChangesetsDaoTest : ApplicationDbTestCase() {
private val P = "Brasliweks"
private val SOURCE = "test"

@BeforeTest fun createDao() {
@Before fun createDao() {
dao = OpenChangesetsDao(database)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ import de.westnordost.streetcomplete.data.osm.mapdata.LatLon
import de.westnordost.streetcomplete.data.osm.mapdata.Node
import de.westnordost.streetcomplete.data.osm.mapdata.NodeDao
import de.westnordost.streetcomplete.util.ktx.containsExactlyInAnyOrder
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotNull
import kotlin.test.assertNull
import kotlin.test.assertTrue
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test

class ElementGeometryDaoTest : ApplicationDbTestCase() {
private lateinit var dao: ElementGeometryDao
private lateinit var nodeDao: NodeDao

@BeforeTest fun createDao() {
@Before fun createDao() {
nodeDao = NodeDao(database)
val relationGeometryDao = RelationGeometryDao(database, PolylinesSerializer())
val wayGeometryDao = WayGeometryDao(database, PolylinesSerializer())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ import de.westnordost.streetcomplete.data.ApplicationDbTestCase
import de.westnordost.streetcomplete.data.osm.mapdata.ElementType
import de.westnordost.streetcomplete.data.osm.mapdata.LatLon
import de.westnordost.streetcomplete.util.ktx.containsExactlyInAnyOrder
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertEquals
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
import kotlin.test.assertFailsWith
import kotlin.test.assertNotNull
import kotlin.test.assertNull
import kotlin.test.assertTrue

class RelationGeometryDaoTest : ApplicationDbTestCase() {
private lateinit var dao: RelationGeometryDao

@BeforeTest fun createDao() {
@Before fun createDao() {
dao = RelationGeometryDao(database, PolylinesSerializer())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ import de.westnordost.streetcomplete.data.ApplicationDbTestCase
import de.westnordost.streetcomplete.data.osm.mapdata.ElementType
import de.westnordost.streetcomplete.data.osm.mapdata.LatLon
import de.westnordost.streetcomplete.util.ktx.containsExactlyInAnyOrder
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertEquals
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
import kotlin.test.assertFailsWith
import kotlin.test.assertNotNull
import kotlin.test.assertNull
import kotlin.test.assertTrue

class WayGeometryDaoTest : ApplicationDbTestCase() {
private lateinit var dao: WayGeometryDao

@BeforeTest fun createDao() {
@Before fun createDao() {
dao = WayGeometryDao(database, PolylinesSerializer())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ package de.westnordost.streetcomplete.data.osm.mapdata
import de.westnordost.streetcomplete.data.ApplicationDbTestCase
import de.westnordost.streetcomplete.util.ktx.containsExactlyInAnyOrder
import de.westnordost.streetcomplete.util.ktx.nowAsEpochMilliseconds
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertNotNull
import kotlin.test.assertNull
import kotlin.test.assertTrue
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test

class NodeDaoTest : ApplicationDbTestCase() {
private lateinit var dao: NodeDao

@BeforeTest fun createDao() {
@Before fun createDao() {
dao = NodeDao(database)
}

Expand Down
Loading