Используя Знатока для проектов C/C++

Если у Вас есть ряд элементов для нахождения в массиве, можно или искать каждого из них линейно или отсортировать массив и затем использовать двоичный поиск с тем же предикатом сравнения. Последний намного быстрее.

83
задан Rich Seller 9 October 2009 в 18:54
поделиться

1 ответ

I highly recommend the maven-nar-plugin. I find it superior in many ways to the alternatives. It doesn't require listing out source files, handles multiple OSes and architectures, handles unit and integration tests, and generally follows "the maven way". It introduces a new kind of packaging - the NAR, or "native archive", that contains the artifact you care about (.dll, .so, .a, .exe, etc.) but also metadata, headers, etc. in a way that makes sense.

It does require a bit of up front work to package third-party software up into NARs, but its pretty straightforward. Once they are NARs, you simply use the normal Maven dependency mechanism to link with them, for example:

<dependency>
  <groupId>cppunit</groupId>
  <artifactId>cppunit</artifactId>
  <scope>test</scope>
</dependency>

One drawback is that it does not appear to be actively maintained, but it is full-featured and is a rather impressive example of Maven plugin authoring.

89
ответ дан 24 November 2019 в 08:56
поделиться
Другие вопросы по тегам:

Похожие вопросы: