This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun Project.propertyOrEmpty(name: String): String { | |
| val property = findProperty(name) as String? | |
| return property ?: environmentVariable(name) | |
| } | |
| fun environmentVariable(name: String) = System.getenv(name) ?: "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defaultConfig { | |
| buildConfigField( | |
| "String", | |
| "AUTH_CLIENT_SECRET", | |
| buildConfigProperty("GameCatalogueApp_AuthClientSecret") | |
| ) | |
| resValue( | |
| "string", | |
| "pusher_key", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| signingConfigs { | |
| create("upload") { | |
| storePassword = propertyOrEmpty( | |
| "GameCatalogueApp_UploadKeystore_KeyPassword" | |
| ) | |
| } | |
| } | |
| fun Project.propertyOrEmpty(name: String): String { | |
| val property = findProperty(name) as String? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| GameCatalogueApp_UploadKeystore_KeyPassword=aaaabbbbcccc | |
| GameCatalogueApp_AuthClientSecret=123456789 | |
| GameCatalogueApp_Pusher_APIKey=ksldjalksdjskald |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data class MessageId(val raw: UUID) | |
| data class ChatId(val raw: String) | |
| data class PersonId(val raw: Long) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val Identifier<UUID>.uuidString: String | |
| get() = rawValue.toString() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun Team.inviteMember(id: MemberId) {} | |
| // ❌ Compile error: Type mismatch. | |
| team.inviteMember(team.id) | |
| // ✅ Compiles. | |
| team.inviteMember(member.id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Team.kt | |
| typealias TeamId = Identifier<Team, UUID> | |
| data class Team(val id: TeamId) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data class Identifier<EntityT, RawT>( | |
| val rawValue: RawT | |
| ) | |
| data class Room(val id: Identifier<Room, UUID>) | |
| data class Meeting(val id: Identifier<Meeting, UUID>) | |
| fun bookMeeting(id: Identifier<Meeting, UUID>) {} | |
| // ❌ Compile error: Type mismatch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data class Identifier<RawT>(val rawValue: RawT) |