Skip to content

Commit

Permalink
Deliver Fontforge assets
Browse files Browse the repository at this point in the history
  • Loading branch information
ViliusSutkus89 committed Dec 14, 2023
1 parent 8ece5cc commit ac12eae
Showing 1 changed file with 39 additions and 5 deletions.
44 changes: 39 additions & 5 deletions fontforge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@ import com.android.ndkports.CMakeCompatibleVersion
import com.android.ndkports.PrefabSysrootPlugin
import org.gradle.jvm.tasks.Jar

// @TODO: bundle assets

group = rootProject.group

// Hardcode a list of available versions
val portVersion = when(project.findProperty("packageVersion")) {
"20170731" -> {
version = "20170731-beta-5"
version = "20170731-beta-6"
"20170731"
}
"20200314" -> {
version = "20200314-beta-9"
version = "20200314-beta-10"
"20200314"
}
else /* "20230101" */ -> {
version = "20230101-beta-8"
version = "20230101-beta-9"
"20230101"
}
}
Expand Down Expand Up @@ -323,6 +321,18 @@ when (portVersion) {
"Requires: libturbojpeg libpng16 libspiro libuninameslist"
)
}

val dst = layout.buildDirectory.asFile.get().resolve("assets/fontforge/share").apply { mkdirs() }
// @TODO: check if different ABI has matching share contents
installDirectoryFor(com.android.ndkports.Abi.Arm).resolve("share").copyRecursively(dst) { file, exception ->
if (exception !is FileAlreadyExistsException) {
throw exception
}
if (!file.readBytes().contentEquals(exception.file.readBytes())) {
throw exception
}
OnErrorAction.SKIP
}
}
}
}
Expand All @@ -345,6 +355,18 @@ when (portVersion) {
overwrite = true
)
}

val dst = layout.buildDirectory.asFile.get().resolve("assets/fontforge/share").apply { mkdirs() }
// @TODO: check if different ABI has matching share contents
installDirectoryFor(com.android.ndkports.Abi.Arm).resolve("share").copyRecursively(dst) { file, exception ->
if (exception !is FileAlreadyExistsException) {
throw exception
}
if (!file.readBytes().contentEquals(exception.file.readBytes())) {
throw exception
}
OnErrorAction.SKIP
}
}
}
}
Expand All @@ -367,6 +389,18 @@ when (portVersion) {
overwrite = true
)
}

val dst = layout.buildDirectory.asFile.get().resolve("assets/fontforge/share").apply { mkdirs() }
// @TODO: check if different ABI has matching share contents
installDirectoryFor(com.android.ndkports.Abi.Arm).resolve("share").copyRecursively(dst) { file, exception ->
if (exception !is FileAlreadyExistsException) {
throw exception
}
if (!file.readBytes().contentEquals(exception.file.readBytes())) {
throw exception
}
OnErrorAction.SKIP
}
}
}
}
Expand Down

0 comments on commit ac12eae

Please sign in to comment.